开发者

How to: get time zones in .net framework 2.0

开发者 https://www.devze.com 2022-12-14 22:37 出处:网络
I am looking for a method which can fetch available time zones. Using .net framework 3.5 I got method to do the same, but I am looking to fetch it using .net framework 2.0.

I am looking for a method which can fetch available time zones.

Using .net framework 3.5 I got method to do the same, but I am looking to fetch it using .net framework 2.0.

.net framework 3.5 specific code is as follows;

Dim timeZones As ReadOnlyCollection(Of TimeZoneInfo) = TimeZoneInfo.GetSystemTimeZones()
For Each timeZoneInfo As TimeZoneInfo In timeZones
    Console.WriteLine("{0}", timeZoneInfo.Di开发者_运维知识库splayName)
Next

Thanks in advance for any kind of help.


I believe this article contains the source that is compatible with .NET 2.0:

http://www.codeproject.com/KB/vb/TimeZoneInfo.aspx

If you grab their source you can check out how they did GetTimeZones method for their TimeZone class.

0

精彩评论

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