Getting Started

Summary: How do I use it to display a date and time using the Twig date filter while catering for timezone?

Symfony twig display date,The "Date" filter of Twig accept a second parameter: "timezone".

So, you can easily display all timezone that you want, twig date now. For example:

{{ "now"|date("m/d/Y H:i", "Europe/Paris") }}
{{ "now"|date("m/d/Y H:i", "Asia/Calcutta") }}
{{ "now"|date("m/d/Y H:i", "Europe/Berlin") }}

For more informations: http://twig.sensiolabs.org/doc/filters/date.html#timezone

Comments

Sign in to publish a comment

0 comments

Be the first to comment on this post.