How to: get time zones in .net framework 2.0

五迷三道 提交于 2019-12-11 05:57:33

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/1979744/how-to-get-time-zones-in-net-framework-2-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!