Custom date in archetypes

I checked the archetype doc: https://gohugo.io/content-management/archetypes/#hugo-docs-custom-archetype but found no mention of the possibility of custom dates,

is it possible to format the date to get something like this (stopping at minutes):
date: 2017-05-04T06:50

thanks!

Currently no, but I’m not sure why it matters – you can easily truncate/format the date when you present.

i currently edit dates to order posts on my frontpage, this would make them easier to read, but yes this might not be the most efficient way,

is it possible maybe to sort posts by date (just taking the year and day into consideration) then sort them by weight?

i checked https://gohugo.io/templates/lists/#by-weight but i don’t see any way to customize it,

We will revise the archetype handling (and many people ask for it, so better sooner than later), and one of the things we’re going to do is to allow template syntax in these archetype files. This way you can do date = {{ now.Format "2006-01-02" }} or whatever. But we need for someone to get to it first …

I can add some testimonial.

  1. It is clear to me that the date format inside the content frontmatter is not the date format that will be displayed on the website, as @bep said.
  2. Now I created an article to be published with Hugo and Latex with Pandoc. And here there was an issue because the date format with Pandoc is copied verbatim on the document heading if it is not understood, which is the case with de default date format in the frontmatter. So for sustainable writing, it might be good to consider that, although this is not for my needs.
  3. @Minimouse: are you estimating that frontmatter late is not readable enough as is? I am specifically speaking about the raw file readability. Is that most important for you?

thanks a lot for the inputs!

are you estimating that frontmatter late is not readable enough as is? I am specifically speaking about the raw file readability. Is that most important for you?

The frontmatter is readable enough i think, except for the date,

the date is quite hard to read for me, I often edit the wrong part, but if it’s possible to limit the amount of infos included it would be way easier, it happens when i edits lot of entries and try to work as fast as possible,

going from:
date: 2017-05-07T08:52:13+02:00
to
date: 2017-05-07T08:52
would probably ease the reading,

i don’t know if the “T” in the date is a norm, but it’s way less readable than something like
2017-05-07_08:52:13+02:00
the “T” makes the date looks like a single block,