Invalid .Date rendered as "-0400 -0400" and "-0400 EDT"

Hello all.
I have a weird problem

.Date gets rendered with the timezone offset twice . sometimes as “-0400 -0400” and also sometimes it’s "-0400 EDT’ for other posts, seemingly randomly? i don’t have any date specific config in my config file, i just use {{ .Date }}, see gist here for my template, the frontmatter used, and the output for a few different posts https://gist.github.com/Dieterbe/f3128acdc1d15832e12b48572cd9b922

thanks!

You should use .Date.Format give it a try with this snippet.

<time datetime="{{ .Date.Format "2006-01-02T15:04:05-07:00" }}" itemprop="datePublished">

Fixed it myself right now in my template - there was a wrong-format-error from W3C validator, now it works fine.

2 Likes

splendid! works indeed. thanks