Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twig - format date

Tags:

php

datetime

twig

I am working on a project built with craft cms, that uses twig templating, and I would like to format the date in to this kind of format:

13. June 2017

I am not sure how to do that, I have tried with php date functions:

{{ entry.dateUpdated.date('j. F Y') }}

and also with:

{{ entry.dateUpdated.localeDate('j. F Y') }}

But, none of them worked. How can I do that?

like image 627
Leff Avatar asked Jun 13 '17 09:06

Leff


1 Answers

try this

{{ entry.dateUpdated  | date('j. F Y') }}
like image 189
Michał G Avatar answered Oct 08 '22 19:10

Michał G