.Date.Format results in weird, future dates

Perhaps there’s something that I’m obviously doing wrong, but I’ve been breaking my head over this for a week now.

In frontmatter, the date of my page is set as follows:

date: 2019-02-13T17:08:07+01:00

When I use {{ .Date.Format "1 January 2019" }} to render this date in my template, the resulting date is ** 2 February 13029**.

That doesn’t compute in my brain. I’ve changed my tempate to use the dateFormat function instead, with the same result.

I much appreciate any advice!

1 Like


Go / Hugo uses the values of a specific point in time for formatting dates: Mon Jan 2 15:04:05 MST 2006. So you probably need to do {{ .Date.Format "2 January 2006" }}

1 Like

Wow, excellent, I didn’t realize there was something ‘special’ about this date, when wading through the Hugo docs. Thanks a million.

Another side reference :slight_smile: