1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-30 04:39:02 +01:00

X509: fix issues when using datetime without a timezone set in ini

This commit is contained in:
terrafrost 2017-09-30 22:54:33 +01:00
parent b6d0e37432
commit 6f47ef808e

View File

@ -3908,8 +3908,8 @@ class File_X509
function setStartDate($date)
{
if (class_exists('DateTime')) {
$date = new DateTime($date);
$this->startDate = $date->format('D, d M Y H:i:s O', new DateTimeZone(@date_default_timezone_get()));
$date = new DateTime($date, new DateTimeZone(@date_default_timezone_get()));
$this->startDate = $date->format('D, d M Y H:i:s O');
} else {
$this->startDate = @date('D, d M Y H:i:s O', @strtotime($date));
}