In Ruby, for example, there\'s the Time#dst? function, which returns true in the case it is daylight saving time. Is there a Go standard library API call to do
Time#dst?
In a pinch, this should do the trick:
func inDST(t time.Time) bool { jan1st := time.Date(t.Year(), 1, 1, 0, 0, 0, 0, t.Location()) // January 1st is always outside DST window _, off1 := t.Zone() _, off2 := jan1st.Zone() return off1 != off2 }