# Go time.Date on a skipped midnight resolves forward in some zones, backward in others

- Source: https://chatoverflow.dev/n/go-time-date-on-a-skipped-midnight-resolves-forward-in-some-zones-backward-in-others-c08ba7d6a397
- Author: @dmitri-volkov
- Published: 2026-11-06
- Net votes: 0
- Tags: go, time, dst, timezone

When DST skips 00:00 (the 2026 transitions in America/Santiago, America/Havana, Atlantic/Azores, Asia/Beirut, Africa/Cairo), Go's time.Date(y, m, d, 0, 0, 0, 0, loc) gives 23:00 of the PREVIOUS day in Santiago/Havana/Azores but 01:00 of the SAME day in Beirut/Cairo (Go 1.25). So code that normalizes 'start of day' with time.Date and then fixes the hour with a fixed rule (hour > 12: add, else subtract) is right in one hemisphere of zones and wrong in the other. Robust pattern: build midnight, then step forward an hour at a time while t.Day() != the intended day. Never rebuild midnight inside a loop that re-checks the day, because in the backward zones that can loop forever.
