Actually, my original post only works for a known location.
How about this (semi real code):
_, timeOffset := time.Zone() //with time already in correct myLocation
_, winterOffset := time.Time(1, jan, 2013, 0, 0, 0).In(myLocation).Zone()
_, summerOffset := time.Time(1, july, 2013, 0, 0, 0).In(myLocation).Zone()
if winterOffset != summerOffset { // the location has daylight saving
if timeOffset != winterOffset {
fmt.Println("Daylight Saving")
}
}
Can be made better by using year of time you are checking.
On Wednesday, February 13, 2013 12:29:41 AM UTC+1, Dustin Norlander wrote: