Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Time Zones list in c# [duplicate]

Tags:

timezone

c#

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.

like image 929
Navid Rahmani Avatar asked Jun 16 '11 13:06

Navid Rahmani


People also ask

How do I find my TimeZone ID?

To get all the IDs of the TimeZone in Java, we use the getAvailableIDs() method. The getAvailableIDs() method returns all the available IDs which are compatible.

What is TimeZoneInfo C#?

The TimeZoneInfo class offers significant enhancements over the TimeZone class, which provides only limited functionality. The TimeZone class recognizes only the local time zone, and can convert times between Coordinated Universal Time (UTC) and local time.

What is a TimeZone ID?

The Time zone ID column lists time zones, in boldface, and the locations within each time zone. The Raw offset column lists the difference, in hours and minutes, between Greenwich Mean Time (GMT) and the specified time zone.


1 Answers

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.

like image 134
Robert Greiner Avatar answered Sep 21 '22 07:09

Robert Greiner