From (ISO3166-1 alpha2 + ISO3166-2) country+region code to timezone?
Hello, How is it possible to get the timezone for a specific datetime and a (ISO3166-1 alpha2, ISO3166-2) pair, i.e. a country code + region code ? Example: ISO3166 -> TimezoneDE-BE -> Europe/Berlin AU-TAS -> Australia/Hobart or Australia/Tasmania US-NY -> America/NewYork Thank you in advance,Jo PS: I have seen the file "iso3166.tab" but this is only for country codes, i.e. the first part of ISO3166.
On 11/29/20 1:53 PM, Joseph Ernest via tz wrote:
How is it possible to get the timezone for a specific datetime and a (ISO3166-1 alpha2, ISO3166-2) pair, i.e. a country code + region code ?
Country code + region code won't suffice, since time zone boundaries do not always respect region boundaries. If you start with geolocation instead, you'll have better luck. See: https://data.iana.org/time-zones/tz-link.html#boundaries
On 2020-11-29 16:37, Paul Eggert wrote:
On 11/29/20 1:53 PM, Joseph Ernest via tz wrote:
How is it possible to get the timezone for a specific datetime and a (ISO3166-1 alpha2, ISO3166-2) pair, i.e. a country code + region code ?
Country code + region code won't suffice, since time zone boundaries do not always respect region boundaries.
If you start with geolocation instead, you'll have better luck. See:
And there are municipalities on political and time zone boundaries where they just pick one of the adjacent zones for pragmatic reasons. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]
participants (3)
-
Brian Inglis -
Joseph Ernest -
Paul Eggert