-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full list of TimeZoneInfos #49
Comments
Not sure exactly what you mean exactly. Can you provide an example of what you'd expect? TimeZoneConverter has a |
What I'm looking for is
|
I assume you are referencing the format column in this Wikipedia page? One thing to keep in mind is that "deprecated" zones there really just mean that they aren't in the prefered area/locality format, so they should be generally removed from a pick-list. I assume that is your use case? But that doesn't mean they don't work any more. In general, once a time zone id is introduced, it doesn't tend to go away. There has been one exception ( Also, I don't this status in these libraries presently. I will consider it for the future and leave this issue open to remind me, but I make no promises. Thanks. |
Yes, this is basically for allowing users to select their timezone from a dropdown, and it seems prudent to prune the (rather large) list by removing ones that are no longer in use. Since |
Oh, I'm sorry - I misunderstood. I see what you mean now. Yes, today you can build this list like so: var threshold = DateTimeOffset.Now;
var ids = TZNames.GetCountryNames("en").Keys
.SelectMany(code => TZNames.GetTimeZoneIdsForCountry(code, threshold))
.Concat(TZNames.GetFixedTimeZoneIds())
.Distinct()
.OrderBy(x => x); And yes, I agree this should be built in as a simpler single function. Thanks for the suggestion. |
I'm sure I'm missing something really obvious here, but is there a way to get a list of
TimeZoneInfo
s for all canonical IANA timezone IDs that are valid as of a given date?The text was updated successfully, but these errors were encountered: