From 999b1c48c5a596f5e9cf0fd79a55ea2cb32e1086 Mon Sep 17 00:00:00 2001 From: Andrew Baker Date: Mon, 14 Jan 2013 16:07:52 +0000 Subject: [PATCH] Force timezone setting in date filter --- lib/Twig/Extension/Core.php | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 01eaee0..10baa20 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -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; } /** -- 1.7.2.5