Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Print page created / last updated

Started by Susanne Broche 8 years ago · 0 replies · 577 views
8 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 Hanns Mattes, 3 weeks ago
1 266 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 195 3 weeks ago
General · by Jerry Hunt, 3 weeks ago
2 330 3 weeks ago
General · by pamtbaau, 3 weeks ago
1 253 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 220 3 weeks ago