Where has TimeZone2 class gone?

If you are following blogs about .net 3.5 you might have across this interesting post. It explains the benefits of new TimeZone2 class residing in .net 3.5 System.Core assembly. The best feature of TimeZone2 for me is the ability to convert time from and to different time zones. Perhaps it is worth to mention that dealing with time zones (read: dealing with daylight saving time) is something I would really like to avoid. Unfortunately world leaders don't think so and they are not just keeping up with daylight saving times, oh no, they keep changing the rules often, just to make it worse.

Before TimeZone2 was introduced one had to do the conversion between different time zones manually - as old TimeZone class knows only to transform from/to current time zone (ToLocalTime, ToUniversalTime). So, hura, for new TimeZone2 as described in the post mentioned above. I'll just use it.

<few minutes pass>

Hm, where is TimeZone2? No sign at all of it. Even reflector can't find it. After a little more reflectoring (using clues that TimeZone2 resides in new System.Core dll under namespace System) I've soon found the best new class that resembles the TimeZone2: TimeZoneInfo. Perhaps this change is mentioned somewhere, I just couldn't find it.

To make it short: if you are looking after TimeZone2 you should use TimeZoneInfo instead, the swiss knife like tool for dealing with time zones - this is what TimeZone should be from the beginning.

UPDATE: Here is a post that mentions renaming of TimeZone2.

Comments (3) -

  • Josh Free

    12/6/2007 12:10:21 AM | Reply

    Hi Miha,
    You're correct, System.TimeZoneInfo was briefly called System.TimeZone2 back in some of the very early .NET Framework 3.5 Beta and CTP releases.

  • Miha Markic

    12/6/2007 9:31:32 AM | Reply

    Josh,

    Thanks for confirmation. I've found blog posts about TimeZone2 but none mentioned the renaming.

Loading