Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Page.date(): just a number?!

Started by Muut Archive 10 years ago · 2 replies · 439 views
10 years ago

I tried to get the page date within a twig file by using page.date and that returns me number: `1480266162. How can I transform that into a decent date format?

10 years ago

Unix time is very handy as it's an integer rather than a DateType. Easier to parse and express than having to convert between uncertain formats (fuzzy-matching is hell).

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2588 9 years ago
Archive · by Muut Archive, 9 years ago
2 1703 9 years ago
Archive · by Muut Archive, 9 years ago
2 4996 9 years ago
Archive · by Muut Archive, 9 years ago
1 3826 9 years ago
Archive · by Muut Archive, 9 years ago
3 1810 9 years ago