Specify date format in archetype?

Obviously Bjørn is correct, and to demonstrate:

archetypes/date.md

+++
title = "{{ .Date }}"
date = "{{ .Date }}"
+++

{{ now.Format "2006-01-02" }}
{{ now.Format "2006-02-01" }}
{{ now.Format "02-2006-01" }}
{{ now.Format "02-01-2006" }}
{{ now.Format "01-20-2006" }}
{{ now.Format "01-2006-02" }}

Produces content/date/nowformat.md

+++
title = "2017-11-06T01:02:52-08:00"
date = "2017-11-06T01:02:52-08:00"
+++

2017-11-06
2017-06-11
06-2017-11
06-11-2017
11-60-2017
11-2017-06

Super handy! :slight_smile:

1 Like