The Many Faces of Pain – Daylight Savings Time

I have never given much thought to DST, I simply adjust my clocks when the world tells me to. But daylight savings time turns out to be a hideous beast hidden from the teeming masses because it is so arbitrary and random, it’s useless.
Time zones are complicated and seemingly random due to political, social, and geographical factors. Imagine a tiny country like Luxembourg having a time zone split right down the center of its 100km wide borders, Luxembourgians would go crazy waking up in one time zone and having to commute to work in another time zone 20 minutes away. It is for reasons like this that time zones often share boundaries with political jurisdictions. Although many smaller jurisdictions such as Arizona and Newfoundland have multiple time zones, how some jurisdictions handle time zones is truly puzzling. China, the worlds 4th largest country by land mass has only one time zone while Nepal defines its time zone as 5 hours and 45 minutes ahead of GMT (as opposed to the usual 1 hour increments). This could be the mountain kingdom being irrational, or it could be because the elevation in Nepal (sitting atop the Himalayas) is so high up the Sun is somehow 45 minutes different rather than 60 minutes different.
Time zones are strange enough, but things get downright chaotic when you throw in daylight savings time. The original purpose of DST was to extend the number of daylight hours people had in the evenings during summer, thus using less energy for incandescent light bulbs. Clocks are typically adjusted ahead one hour in the beginning of spring and back in autumn. Not every country thinks DST is a good idea, this map shows that most of the world doesn’t actually care for DST. Looking at this map, you’ll notice that Canada mostly adheres to DST except Saskatchewan, the north eastern tip of BC and an island north of Hudson’s Bay that I’ve never noticed before.
Another issue with DST is how it’s decided when to change the time. Since 2007 the first Sunday of April and last Sunday of October are when DST changes happen in N. America. Whereas the EU tends to kick off DST with the last Sunday of March and last Sunday of October.
In the Southern Hemisphere though, DST changes happen in reverse, Chile observes DST from the second Saturday in October to the second Saturday in March. The time difference between the United Kingdom and mainland Chile may therefore be three, four, or five hours, depending on the time of year.
If you were programming a time sensitive client server applicaion such as Schedule Bin, you will quickly find that dealing with time zone offsets is a frustrating and unrewarding experience. The Google App Engine stores all datetime’s in UTC, you must store any time zone info separately, and as time zone offsets vary all the time for arbitrary reasons, it’s important to make sure you aren’t scheduling someone to work one hour before they are supposed to start working.
After spending more time than I care to admit looking for solutions, I ended up using pytz. It has the Olson database hooked right in to it that takes much of the tediousness out of worrying about whether or not to add an hour to an employee’s shift start time in Halifax on April 4th, 2013.







Wow, you realize the difficulties of simple things. All this work and most likely the user will never notice.
It’s true… If anything, users will be annoyed that they have to pick the timezone they are in.