Can someone please point me to a complete list of all the timezones referenced by the id expected in TimeZoneInfo.FindTimeZoneById()
? I can't find a list anywhere and I've looked through the .NET documentation.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I suspect this is what most people are looking for:
Microsoft Time Zone Index Values
Hopefully MS keeps it up to date even after XP.
Here's the link you're looking for:
C# System timeZoneID's
This is the code fully tested and working for me. You can use it just copy and paste in your aspx page and cs page.
This is my blog you can download full code here. thanks.
http://www.c-sharpcorner.com/blogs/display-all-the-timezone-information-in-dropdown-list-of-a-local-system-using-c-sharp-with-asp-net
List of time zone identifiers, included by default in Windows XP and Vista: Finding the Time Zones Defined on a Local System
And if you'd like a HTML select with the Windows time zones in:
And if you'd like to use it in C#.NET MVC in a Razor view:
Although for Razor you can of course just generate the options by looping through
TimeZoneInfo.GetSystemTimeZones()
Here's a full listing of a program and its results.
The code:
The TimeZoneId results on my Windows 7 workstation: