diff --git a/src/I18n/Time.php b/src/I18n/Time.php index 9789a95e8ac..281200f9f8b 100644 --- a/src/I18n/Time.php +++ b/src/I18n/Time.php @@ -113,7 +113,8 @@ class Time extends Carbon implements JsonSerializable public function __construct($time = null, $tz = null) { if ($time instanceof \DateTime) { - list($time, $tz) = [$time->format('Y-m-d H:i:s'), $time->getTimeZone()]; + $tz = $time->getTimeZone(); + $time = $time->format('Y-m-d H:i:s'); } if (is_numeric($time)) { @@ -694,7 +695,8 @@ public static function parseDateTime($time, $format = null) $timeFormat = $pattern = null; if (is_array($dateFormat)) { - list($dateFormat, $timeFormat) = $dateFormat; + list($newDateFormat, $timeFormat) = $dateFormat; + $dateFormat = $newDateFormat; } else { $pattern = $dateFormat; $dateFormat = null;