How to print a variable in twig html file such as for date:
{{ timeComment|date('Y-m-d') }}
I've tried date('Y-m-d H:i:s') but it doesn't work.
How to print a variable in twig html file such as for date:
{{ timeComment|date('Y-m-d') }}
I've tried date('Y-m-d H:i:s') but it doesn't work.
If you want to print the current datetime, you can do this:
{{ "now"|date('Y-m-d H:i:s') }}
See http://twig.sensiolabs.org/doc/filters/date.html for details.