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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Print page created / last updated

Started by Susanne Broche 8 years ago · 0 replies · 526 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 Jerry Hunt, 4 days ago
2 76 8 hours ago
General · by pamtbaau, 13 hours ago
1 47 12 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago