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.
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.
We renamed TimeZone2 to TimeZoneInfo because we received overwhelming feedback from the community against the “TimeZone2” name.
I think we first mentioned the name change in the following blog post:
http://blogs.msdn.com/bclteam/archive/2007/06/07/exploring-windows-time-zones-with-system-timezoneinfo-josh-free.aspx
Thanks,
Justin Van Patten
CLR Program Manager
Josh,
Thanks for confirmation. I’ve found blog posts about TimeZone2 but none mentioned the renaming.