53

Possible Duplicate:
How do I enumerate all time zones in .NET?

How can I get the list of time zones with c#? I want a list like the one windows has.

Community
  • 1
  • 1
Navid Rahmani
  • 7,848
  • 9
  • 39
  • 57

3 Answers3

91

GetSystemTimeZones().

ReadOnlyCollection<TimeZoneInfo> tz;
tz= TimeZoneInfo.GetSystemTimeZones();

Keep in mind that this returns a ReadOnlyCollection(T)

You can also learn how to populate a list with those timezones here.

Robert Greiner
  • 29,049
  • 9
  • 65
  • 85
  • 9
    Thank you! And to whoever marked this as a duplicate, please get off your high horse. This was the first result on google. Sorry I don't want to hunt all over the Internet to find an answer someone may have given 10 years ago. – Emperor Eto Jun 01 '18 at 12:29
8

You can use TimeZoneInfo.GetSystemTimeZones().

Sven
  • 21,903
  • 4
  • 56
  • 63
5
TimeZoneInfo.GetSystemTimeZones()
gdoron
  • 147,333
  • 58
  • 291
  • 367
Winston
  • 500
  • 3
  • 3