mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +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 (null !== $timezone) {
|
||||
$date = clone $date;
|
||||
$date->setTimezone($timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user