3 ms·
fmt.Printf("\n... and %v days after that ...\n", days) t2 := t1.Add(time.Duration(days) * time.Hour * 24) printTime(t2) How is that supposed to work wi
by panic 11y ago
fmt.Printf("\n... and %v days after that ...\n", days)
t2 := t1.Add(time.Duration(days) * time.Hour * 24)
printTime(t2)
How is that supposed to work with daylight saving time? Won't t2 end up one hour off from t1 if there is a daylight saving shift?
- nulltype 11y agoI find it easier to think of times in UTC rather than local timezones. In UTC (and in reality), those times will always be the same number of hours distance from each other. If you format it in different timezones (PDT and PST) then yeah, the formatted times will be at different hours of the day.
- heinrich5991 11y agoThat's not true for UTC, you'd need TAI for that. UTC includes leap seconds.