mattjohnsonpint / TimeZoneNames

Provides a complete source of localized time zone names and abbreviations.
MIT License
196 stars 32 forks source link

Can't map from a Windows Timezone name to a set IANA timezone Ids #39

Closed gavinbarron closed 3 years ago

gavinbarron commented 6 years ago

Given a Windows timezone name I'd like the list of IANA ids that match

mattjohnsonpint commented 6 years ago

Sorry, but are you talking about Windows time zone IDs, or the localized strings in the CLDR language data?

If you're talking about Windows IDs, then generally this is supported by TimeZoneConverter (though currently there's not a method to return an array, but that could be certainly added there).

However, your PR appears to be about reverse-mapping the localization, and it appears to be going through every language in the data for any possible match. I'm a bit concerned about the performance implications of such a linear search, as well as conflicts or oddities that may be present between languages.

Generally, with TimeZoneNames, we're producing a human-readable string for display. Thus, a reverse function such as yours would be useful when parsing human-readable. As such, we would need to think about all sorts of other things that go along with natural language processing. At a minimum, I'd want to constrain it to a specific language or set of languages, rather than searching them all.

Can you elaborate about your intended usage? Thanks.