From 29e1ef854d5946fbe9558da7d7bd88063389a99a Mon Sep 17 00:00:00 2001 From: Michael Shaffer Date: Fri, 23 Dec 2016 18:15:27 -0800 Subject: [PATCH] Fix Eloquent getTimeZone method call to adhere to DateTimeInterface (#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. --- src/Illuminate/Database/Eloquent/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 948a724f84f9..b76d0295986f 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -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() ); }