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

Page.date(): just a number?!

Started by Muut Archive 10 years ago · 2 replies · 353 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 1352 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2949 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago