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

Page.date(): just a number?!

Started by Muut Archive 10 years ago · 2 replies · 402 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 2288 9 years ago
Archive · by Muut Archive, 9 years ago
2 1500 9 years ago
Archive · by Muut Archive, 9 years ago
2 4753 9 years ago
Archive · by Muut Archive, 9 years ago
1 3570 9 years ago
Archive · by Muut Archive, 9 years ago
3 1626 9 years ago