Date formatting with .Format not working

In Front matter for each blog post date is defined as follows.

date = 2019-05-10T10:36:05+05:30

In single template I have added following formatter.

<p>Updated on: <time>{{ .Date.Format "Jan 01, 2006" }}</time></p>

In my output I get following.

Updated on: May 05, 2019

Basically date is always 05 for all blog posts in month of May.

How do I make date different for each post??

Go/Hugo uses a specific point in time as reference for formatting dates: https://gohugo.io/functions/format/#go-s-layout-string

Try {{ .Date.Format "Jan 02, 2006" }} instead.

2 Likes