Lines Matching refs:date
1 ``date``
8 The default date format support has been added in Twig 1.5.
16 The ``date`` filter formats a date to a given format:
20 {{ post.published_at|date("m/d/Y") }}
22 The format specifier is the same as supported by `date`_,
26 The ``date`` filter accepts strings (it must be in a format supported by the
28 instance, to display the current date, filter the word "now":
32 {{ "now"|date("m/d/Y") }}
34 To escape words and characters in the date format use ``\\`` in front of each
39 {{ post.published_at|date("F jS \\a\\t g:ia") }}
41 If the value passed to the ``date`` filter is ``null``, it will return the
42 current date by default. If an empty string is desired instead of the current
43 date, use a ternary operator:
47 {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }}
52 dates and the second one is the default format for date intervals:
65 By default, the date is displayed by applying the default timezone (the one
71 {{ post.published_at|date("m/d/Y", "Europe/Paris") }}
73 If the date is already a DateTime object, and if you want to keep its current
78 {{ post.published_at|date("m/d/Y", false) }}
93 * ``format``: The date format
94 * ``timezone``: The date timezone
99 .. _`date`: https://secure.php.net/date target