mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 05:16:30 +00:00
Fixed the handling of the timezone for DateTime objects
This commit is contained in:
@@ -388,6 +388,7 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $
|
|||||||
|
|
||||||
if ($date instanceof DateInterval || $date instanceof DateTime) {
|
if ($date instanceof DateInterval || $date instanceof DateTime) {
|
||||||
if (null !== $timezone) {
|
if (null !== $timezone) {
|
||||||
|
$date = clone $date;
|
||||||
$date->setTimezone($timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone));
|
$date->setTimezone($timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user