Access publish date from twig template


I tried both ‘page.header.publish_date’ and page.publishDate() to access (and print) the publish date of the page, but none of those methods work.

How can I access the publish date from a twig template?

Hi @mathmax

I live in Switzerland, so my date format is (today’s 25.09.2020). So I’ve put publish_date: 25.09.2020 13:00 in my md file and then use
{{page.header.publish_date}} in my twig template and it works. Check the doc for the right date format according to your country.