开发者

.NET 2.0 - TimeZone Conversion

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.

开发者_JS百科

Anyone who can help?

Good Day;


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


Well, there's always System.TimeZone

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜