Hugo currently has no provision for converting time values from one location to another. If it’s 4:20 PM in Vancouver, Hugo has no idea what time it is in Kiev.
The time.AsTimeTIMEZONE parameter is only useful for dates without offsets. The TIMEZONE parameter qualifies dates without offsets, adding an offset and time zone abbreviation.
If the date already has an offset, the TIMEZONE parameter is ignored.
Assuming you have not set a fallback timeZone in your site configuration…
With v0.164.0 and later use the time.In function and disregard the guidance below.
But Hugo does know the UTC time. So by looking at offsets we can figure it out.
This example use a partial function to return a given time in the target time zone. Twice a year it may be off by an hour in those locations that switch back and forth between STD and DST.
git clone --single-branch -b hugo-forum-topic-41863 https://github.com/jmooring/hugo-testing hugo-forum-topic-41863
cd hugo-forum-topic-41863
hugo serv
This is an excellent solution for non-critical dates.
I hope Hugo will get a (time.Time).In(timezone) function one day as the calculation of offsets is very complicated and nuanced.
Also, there is a fallback solution as to store all the dates on a page in UTC, but convert them with a front-end code like Luxon, but of course, it has its own tradeoffs.