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.

3 thoughts on “Where has TimeZone2 class gone?

Leave a Reply