"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.
To tide people over, we recently released an updated sample that supports the following scenarios:
-Enumeration of Time Zones from the Windows Registry.
-Conversion of a DateTime instance between Time Zones.
The sample can be downloaded from here:
The sample is similar to one that was available in the SDK previously. However, the previous sample did not adjust conversions for Daylight Savings Time. This sample does account for Daylight Savings time in the same way that the DateTime class itself accounts for it for local times. In fact, we used some of the same testing code to verify it.
..."
Timezones... sigh. Being in the EDD field, timezones & daylight savings time come up alot. Personally I think it’s time we kill Daylight Savings Time, but until then (and even after... sigh), I’ll have to deal with it.
Having it baked into the .Net Framework would help a great deal.
The above C# sample is pretty cool in that it avoids using interop to get its job done.
Technorati Tags: C#, Time Zones, DateTime, .Net Framework
No comments:
Post a Comment
NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...
ALL comments are moderated. I will review every comment before it will appear on the blog.
Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...
I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...
Please see my comment policy for more information if you are interested.
Thanks,
Greg
PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...