I just spent all day yesterday, along with a co-worker, tracking down one of the more heinous time calculation bugs I’ve ever seen. If you’re a programmer, you probably already know about the Daylight Savings Time change that is occurring in this year of 2007. This is sending a shock wave of problems through the IT industry on a scale of which we probably haven’t seen since Y2k. Everyone is having to update code that calculates when DST begins and ends.

In short, Microsoft is either in a very tight spot, or they screwed up big time. With the new calculation of DST, any year previous to 2007 now has the potential to show the wrong time! Here is a quick example.

This page is using JavaScript within the viewers browser to calculate dates. You will notice that if you are viewing this page from Vista, or a Linux based OS, that all the dates are displayed as expected. If you’re on a Windows XP or earlier OS, the middle two dates will show as being in DST when they should not be:

Wed Mar 15 00:00:00 CDT 2006 <- Um, not quite yet actually. CDT doesn’t start until April 02, 2006 02:00.

This is because MS OS’ previous to Vista can only store one set of DST rules. So when you installed that cool new patch that fixes 2007 and future dates, you break every year previous to it. Nice. Granted this only crops up in past dates between the previous DST starting time, and the new one. I.e. between 2007 and 2006, this is between March 11 and April 2. See another conversation on this.

This is going to cause problems until it is fixed. Hopefully MS can get us something quickly, but depending on how deeply the OS is affected by this – they could have a serious issue on their hands.

Tags: , ,