From a23d4fbb71a7011b0886cb10c0273598d9474eed Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 3 May 2012 22:25:04 +0200 Subject: [PATCH] Fixed the handling of the timezone for DateTime objects --- lib/Twig/Extension/Core.php | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 301c4bb..37415ae 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -388,6 +388,7 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $ if ($date instanceof DateInterval || $date instanceof DateTime) { if (null !== $timezone) { + $date = clone $date; $date->setTimezone($timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone)); } -- 1.7.2.5