How to: get time zones in .net framework 2.0

2019-08-11 19:15发布

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.DisplayName)
Next

Thanks in advance for any kind of help.

标签: .net timezone
1条回答
可以哭但决不认输i
2楼-- · 2019-08-11 20:01

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.

查看更多
登录 后发表回答