From: Christophe Coevoet Date: Thu, 3 May 2012 20:25:04 +0000 (+0200) Subject: Fixed the handling of the timezone for DateTime objects X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=a23d4fbb71a7011b0886cb10c0273598d9474eed;p=web%2Fkonrad%2Ftwig.git Fixed the handling of the timezone for DateTime objects --- 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)); }