.NET 2.0 - TimeZone Conversion

I need help writing a function that should take a datetime object and a target timezone, and it should return a datetime object after converting it to the target timezone. WHILE reviews Day Light. Save either the target or the current time zone.

A method is also needed to list all available time zones.

I was able to achieve all of this in .NET 3.5, but my client server is running .NET 2.0 and no upgrade is possible.

Who can help?

Good day;

+2


source to share


2 answers


You will need something like an Olson database to get this information, since .NET 2.0 only knows about the current time zone.

Take a look here: http://zoneinfo.codeplex.com/



Edit: here's how to use it: CodeProject article

+3


source


Well, always System.TimeZone



http://msdn.microsoft.com/en-us/library/system.timezone.aspx

+1


source







All Articles