Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Print page created / last updated

Started by Susanne Broche 9 years ago · 0 replies · 673 views
9 years ago

How do I print when a page was created and last changed, e.g. in the footer for a normal page (not for a blog)?

If I use:

{{ page.modified()|date("m/d/Y") }}
{{ page.created()|date("m/d/Y") }}
{{ page.published()|date("m/d/Y") }}

I get:

02/02/2018
02/02/2018
01/01/1970

The page.modified function seems to reflect the correct date (page was changed today), but page.created returns the same value and page.published something completely off (perhaps this related to testing this with php -S?)

Thanks for any help in advance!

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 4 days ago
3 92 18 minutes ago
General · by Old Man Umby, 2 days ago
1 60 2 days ago
General · by Sebastian, 4 days ago
1 81 4 days ago
General · by Andy Miller, 2 weeks ago
0 216 2 weeks ago
General · by ready-4-IT, 6 months ago
1 716 3 weeks ago