Skip to content

Commit

Permalink
Fix Eloquent getTimeZone method call to adhere to DateTimeInterface (#…
Browse files Browse the repository at this point in the history
…16955)

Somehow the getTimeZone call in the asDateTime method is not actually
set to call the method that the DateTimeInterface defines, note the
uppercase Z on zone.
  • Loading branch information
michaelshaffer37 authored and taylorotwell committed Dec 24, 2016
1 parent 96f9789 commit 29e1ef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2979,7 +2979,7 @@ protected function asDateTime($value)
// when checking the field. We will just return the DateTime right away.
if ($value instanceof DateTimeInterface) {
return new Carbon(
$value->format('Y-m-d H:i:s.u'), $value->getTimeZone()
$value->format('Y-m-d H:i:s.u'), $value->getTimezone()
);
}

Expand Down

0 comments on commit 29e1ef8

Please sign in to comment.