Expert Texture Home Contact me About Subscribe Digipede Connect on LinkedIn rwandering on Twitter rwandering on FriendFeed

The blogged wandering of Robert W. Anderson

Microsoft’s DST Fix is a real problem

Dan blogged last night that MSVCRT hasn’t been fixed for the new US daylight savings time (DST) rules that go into effect next month.

Last week, Wayne Citrin posted about a problem with Microsoft’s DST patch for Windows:

There’s a very interesting problem with Microsoft’s DST patch for Windows that you should be aware of, since it can impact date conversion results when mapped date proxies are used.  The patch applies the new rules for whether date and time are daylight savings time without regard to year.  This means that if you ask .NET whether a given DateTime in the past is DST, it will apply the new rules even if the date would have been standard time under the old rules.

Wayne points out that this isn’t really a .NET problem, but an OS issue fixed in Vista.  (and not in XP and presumably Server 2003, and anything before).  

As someone who used to work with lots of timeseries data (and more importantly, conversion in and out of formats that don’t support UTC), I can tell you: properly handling DST can be really hard.  Not rocket science, but hard just the same.

And Microsoft is telling us we can’t trust the tools nor the OS to do this right. 

So you just have to do it yourself — it is easier to fix when Congress enacts some new arbitrary rule.

Tags: , , , ,