Reputation: 854
I need help in writing a function which should take a datetime object and target timezone and it should return a datetime object after converting it to the target timezone - WHILE considering Day Light Saving of either target or current timezone.
Also, need a method to enumerate all available timezones.
I have been able to achieve this all in .NET 3.5, but my client's server is running .NET 2.0 and upgrading it is not possible.
Anyone who can help?
Good Day;
Upvotes: 2
Views: 3814
Reputation: 106494
You'll need something like the Olson database to obtain such info, as .NET 2.0 knows only about the current time zone.
Look here: http://zoneinfo.codeplex.com/
Edit: Here's how to use it: CodeProject article
Upvotes: 3
Reputation: 180777
Well, there's always System.TimeZone
http://msdn.microsoft.com/en-us/library/system.timezone.aspx
Upvotes: 1