}
if ($date instanceof DateInterval || $date instanceof DateTime) {
+ if (null !== $timezone) {
+ $date->setTimezone($timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone));
+ }
+
return $date->format($format);
}
--TEMPLATE--
{{ date1|date }}
{{ date1|date('d/m/Y') }}
+{{ date1|date('d/m/Y H:i:s', 'Europe/Paris') }}
{{ date2|date }}
{{ date2|date('d/m/Y') }}
+{{ date2|date('d/m/Y H:i:s', 'Europe/Paris') }}
{{ date3|date }}
{{ date3|date('d/m/Y') }}
{{ date4|date }}
--EXPECT--
October 4, 2010 13:45
04/10/2010
+04/10/2010 15:45:00
October 4, 2010 13:45
04/10/2010
+04/10/2010 15:45:00
October 4, 2010 13:45
04/10/2010
October 4, 2010 13:45