Anonymous Anonymous - 10 months ago
380 1

Example how to convert a PHP DateTime object to a string in Twig.

Twig

Twig convert DateTime to date string format

{{ publicationDate | localizeddate('short', 'none', null, null, 'yyyy-MM-dd') }}