Nitin S
Nitin S

Reputation: 7601

How to get all USA timezone IDs using nodatime

How to get all USA timezone IDs using nodatime?

https://nodatime.org/TimeZones
Above page lists all timezone ids in nodatime,

is there any API to get all USA timezone IDs?

Upvotes: 1

Views: 134

Answers (1)

Nitin S
Nitin S

Reputation: 7601

found api:

public static List<TzdbZoneLocation> GetAllTimeZones()
{
    return TzdbDateTimeZoneSource.Default
                .ZoneLocations
                .Where(x => x.CountryCode == "US")
                .ToList();
}

Reference: https://gist.github.com/jrolstad/5ca7d78dbfe182d7c1be

Upvotes: 2

Related Questions