diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index d1d46812..0fd6826e 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -2790,10 +2790,10 @@ class X509 public function setStartDate($date) { if (!is_object($date) || !is_a($date, 'DateTime')) { - $date = new DateTime($date); + $date = new DateTime($date, new DateTimeZone(@date_default_timezone_get())); } - $this->startDate = $date->format('D, d M Y H:i:s O', new DateTimeZone(@date_default_timezone_get())); + $this->startDate = $date->format('D, d M Y H:i:s O'); } /** @@ -2817,10 +2817,10 @@ class X509 $this->endDate = new Element($temp); } else { if (!is_object($date) || !is_a($date, 'DateTime')) { - $date = new DateTime($date); + $date = new DateTime($date, new DateTimeZone(@date_default_timezone_get())); } - $this->endDate = $date->format('D, d M Y H:i:s O', new DateTimeZone(@date_default_timezone_get())); + $this->endDate = $date->format('D, d M Y H:i:s O'); } }