Time zones make me cringe

by Michael S. Kaplan, published on 2006/04/03 12:01 -07:00, original URI: http://blogs.msdn.com/michkap/archive/2006/04/03/567489.aspx


I did talk about a particular time zone issue earlier today....

And I see that Anthony posted about a new sample using managed code on the BCLTeam blog.

There is one bit there that I swear makes me cringe every time someone mentions it:

The single most requested individual feature for the Base Class Libraries that has not been delivered yet is for support for Time Zones other than Local and UTC. This is a feature we are actively exploring for the next release of the .NET Framework.

My cringe is in part inspired by the explanation from Raymond Chen of Why Daylight Savings Time is non-intuitive. Every time one of those .NET vs. Win32 compatibility issues raises its head I get nervous, so this one that keeps popping heads up lik a hydra can be quite cringe-inspiring.

The other part that makes me nervous is the sample itself -- seems like no Win9x support (the Win9x registry key is different, something the VB sample in my book took care of), and also seems like it has no support for the Vista updates that support the localized time zone name strings, though of coursed that is not yet in shipping product (I figure a sample could try to be either forward or backward compatible!).

As an aside -- that Vista fix with the time zone names is similar to the one done for keyboard layout names in Windows XP to get them out of the registry too; I'll talk more about this another day for both keyboards and time zones. Incidentally, that keyboard fix is one that the 1.0 and 1.1 versions of .NET did not pick up but I believe the issue was addressed in 2.0....

I should probably stop worrying so much, it's not like the sample can't be updated. And there is plenty of time for the right thing to happen in product....

But I wonder why nothing can ever be easy with time zones. :-(

 

This post brought to you by "" (U+0f16, a.k.a. TIBETAN LOGOTYPE SIGN LHAG RTAGS)


# Jeff Parker on Monday, April 03, 2006 3:49 PM:

I agree with you. Seem like time anywhere other than home has always been wacky. Maybe someday when we refer to it as Stardate we will have solved that problem. I never knew of Spock and Kirk having trouble thinking about what time it was. Then again in space, what did it matter.

# Maurits on Monday, April 03, 2006 3:59 PM:

In the Star Trek: TOS pilot (the cage), Kirk says it is "stardate 1329.8."  Then... LATER... Kirk says it is "stardate 1329.1"

"Fall back," perhaps?

Also see: http://www.straightdope.com/classics/a3_367.html

# Michael S. Kaplan on Monday, April 03, 2006 4:11 PM:

Hmmm... William Shatner was not in The Cage -- he was not in Star Trek until the second pilot. Maybe you meant Jeffrey Hunter, playing Captain Pike? :-)

# Maurits on Monday, April 03, 2006 4:56 PM:

Sorry, wrong episode... it was "Mudd's women"
http://www.ditl.org/datarticle.php?3

# Fil Mackay on Monday, April 03, 2006 5:54 PM:

How would you do this?

With the recent event in Australia (Commonwealth Games), Microsoft had to roll-out an update to amend the timezone schedule for 2006. This was a pain, since that subsequently screwed up any applications (eg. Outlook) that seem to store everything in GMT.

Would you, in this scenario, have to roll-out this patch to all Windows computers world-wide?

I think the solution for Outlook is to store the time in a timezone format (ie. time+TZ identifier). This way when the timezone moves (they do), the time moves with it. I think .NET has a good head-start on that.

# oldnewthing on Tuesday, April 04, 2006 12:24 AM:

It also doesn't support the new "multi-year variable DST start/end" format coming in Vista (necesary for countries like Israel where the cutover date is based in part on the lunar calendar). Those registry key formats are not contractual, and Vista is going to change the rules.

# Michael S. Kaplan on Tuesday, April 04, 2006 12:32 AM:

Indeed -- one of the core problems with any group in Microsoft that goes off to solve a problem when they don't own the actual area they are trying to solve. :-(

Luckily for all of us, Vista ships before whatever version of the .NET Framework would have this addition, so there may be time to force the right thing to happen....

# Phylyp on Tuesday, April 04, 2006 6:01 AM:

Damn this round planet!

# Maurits on Tuesday, April 04, 2006 8:51 AM:

> multi-year variable DST start/end

Uh-oh.  What's going to happen next year when DST starts early and ends late in the US?? (Stupid Energy bill...)

# Michael S. Kaplan on Tuesday, April 04, 2006 11:24 AM:

Fil Mackay has an excellent point, one that I will be blogging about soon....

Though there was also one incorrrect point -- .NET does not have a head start on any solution here -- its notion of UTC v. local time is no different than the Win32 one.

# Michael S. Kaplan on Tuesday, April 04, 2006 11:25 AM:

Hi Maurits --

I'll be blogging about the US DST changes soon -- why they are a really bad idea overall, though why I think they may finally force products like Outlook to do  things correctly....

referenced by

2008/06/29 Did someone break GetTimeZoneInformation in XP?

2006/07/07 Results of the 'Time Zone Scenario Feedback' feared

2006/05/24 Did somebody say time zones were intuitive?

2006/05/06 Keyboards and time zones have something in common

2006/04/05 Ok, so there may be *some* worries here

go to newer or older post, or back to index or month or day