The formatting is wrong since it was set to 2006-01-02 15:04 MST and as per GoLang and Hugo docs, MST should show the timezone abbreviation – in this case JST and KST if the <html lang=""> attribute is detected as ja and ko respectively. Or, PST if it is en-PH (UTC+0800).
This gets weirder because building the site locally, it works perfectly for PST/en-PH (UTC+0800). But as shown in the online example site, when the site was built by gh-pages, PST/en-PH (UTC+0800) is showing the same incorrect formatting as ja/JST (UTC+0900) and ko/KST (UTC+0900).
I think what happens here is something along the lines of the used library defining how in your language the timezone is formatted (characters vs digits). We had that issue slightly related with currencies where US dollars had the dollar sign, and British Pound had UKP as “money marker”.
I am not sure how to apprehend the issue, but maybe you could post your translation configuration and from there we go.
Also compare your local Go, Hugo, System versions to those on your deployment. Maybe you can force GH-pages to use your local settings.
This is the weird part. The results from local testing and gh-pages are different. (Note: gh-pages is not the issue, I only mentioned it because the test site I uploaded is hosted there and I noticed this difference from local.)
I just came across this as well (at least it looks like the same issue) using github deploy to cloudflare Pages. I never noticed it before but this is one of the few times I’ve tried to put a timezone like PST/PDT into a template.
Locally I have Hugo spitting out PDT with correct date/time, once to ships to cloudflare the build returns -0700
I tripped it twice today, so that was me posting on Cloudflare. I wanted to get verbose logs out of the build to see if it was me or not. And if there is some timezone config I needed that I didn’t do correctly and the formatting was just trippin on not having a timezone set. No joy as of yet. Still tinkering.
My timestamp comes back correct to the posts frontmatter, which was generated locally by me. So that all matches. I’m getting back incorrect formatting on the output that is rendered.
I was also able to replicate it on Netlify just now. So that leads me to think it’s some form of timezone setting/mismatch with the servers.
Gonna sleep on it, cause I feel a little crazy after trying to track it down in my spare time for a few days. I will laugh when I actually just skipped some step that I should have done for the last year.
I can’t say I’ve ever noticed an issue before, but this didn’t occur until I put the MST in the time.Format.
It only works if you have one time zone. If your site is multilingual, which means your timezone is different for each language, it will only work for the timezone that matches the environment variable that was manually set.
It works if TZ environment variable matches the hugo-config and/or frontmatter timezone: