Force timezone setting in date filter
authorAndrew Baker <abaker@inviqa.com>
Mon, 14 Jan 2013 16:07:52 +0000 (16:07 +0000)
committerAndrew Baker <abaker@inviqa.com>
Mon, 14 Jan 2013 16:07:52 +0000 (16:07 +0000)
lib/Twig/Extension/Core.php

index 01eaee0..10baa20 100644 (file)
@@ -473,7 +473,9 @@ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = nu
         return $date;
     }
 
-    return new DateTime($date, $defaultTimezone);
+    $date = new DateTime($date, $defaultTimezone);
+    $date->setTimezone($defaultTimezone);
+    return $date;
 }
 
 /**