Present a date object in different timezones

EDIT 2025-04-14T11:30:26-07:00

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
2 Likes