{{ date4|date('d/m/Y') }}
{{ date5|date }}
{{ date5|date('d/m/Y') }}
-{{ date6|date }}
-{{ date6|date('%d days %h hours') }}
--DATA--
date_default_timezone_set('UTC');
return array(
'date3' => '2010-10-04 13:45',
'date4' => 1286199900,
'date5' => -86410,
- 'date6' => new DateInterval('P2D'),
)
--EXPECT--
October 4, 2010 13:45
04/10/2010
December 30, 1969 23:59
30/12/1969
-2 days
-2 days 0 hours
--TEMPLATE--
{{ date1|date }}
{{ date1|date('d/m/Y') }}
-{{ date2|date }}
-{{ date2|date('%d days') }}
--DATA--
date_default_timezone_set('UTC');
$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours');
return array(
'date1' => mktime(13, 45, 0, 10, 4, 2010),
- 'date2' => new DateInterval('P2D'),
)
--EXPECT--
2010-10-04
04/10/2010
-2 days 0 hours
-2 days