Skip to content

Commit

Permalink
dont pass time zone when null for php 5.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tflori committed Mar 26, 2019
1 parent a9e712d commit 06230de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Examples/DateTimeDerivate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class DateTimeDerivate extends \DateTime
*/
public static function createFromFormat($format, $time, $timezone = null)
{
$dt = parent::createFromFormat($format, $time, $timezone);
$dt = $timezone === null ?
parent::createFromFormat($format, $time) :
parent::createFromFormat($format, $time, $timezone);
return new static($dt->format('Y-m-d H:i:s.u'), $dt->getTimezone());
}
}

0 comments on commit 06230de

Please sign in to comment.