Format date as YY-MM-DD HH:mm


#1

Hello guys!

Does anyone has a solution? I get “00:00” as time in the article. See example: https://wasim.blog/post/how-is-everyone-changing-world/

In the code, I’m using {{ .Date.Format “Jan 2, 2006 15:04” }} and there is no special mention to this in config file.


How to format .Date with 'YY-MM-DD HH:mm'?
#2

Hi @mrwullah – split your post into a new topic, and referenced the old one


#3

@zwbetz
Actually, I found the solution. Just did.


#4

I see you just needed to convert the smart quotes to standard quotes, then this works:

{{ .Date.Format "Jan 2, 2006 15:04" }}

#5

@zwbetz, I compared my codes with a blog that is working fine. In single.html file, I am using <time>{{ .Date.Format "2006-01-02 15:04" }}</time> then, on posts, I would use date: 2015-02-23T22:00:00.


#6

Also see: