HI Guillermo - I think what you're looking for is the algorithm defined in the JavaScript Internationalization (ECMA-402) specification. Specifically, the AvailableNamedTimeZoneIdentifiers <https://tc39.es/ecma402/#sup-availablenamedtimezoneidentifiers> abstract operation.
This algorithm enumerates through all time zones, ensuring at least one time zone per country while removing outdated intra-country links like America/Montreal that have had the same time zone history since 1970 as other zones. I wrote the section of the specification linked above, so I know it pretty well and am happy to answer questions about it. Note that this algorithm wasn't a new thing; it simply reverse-engineers and provides formal spec language for the existing rules that CLDR (the internationalization data source used by JavaScript, Java, and more) has used for 10+ years when deciding which zones to enumerate and which to omit. Note that as of today, only Firefox actually follows this specification exactly. Chrome (using the V8 JavaScript engine) and Safari/iOS/MacOS (using the JavaScriptCore JS engine) will be adopting it in 2026 when their implementations are complete. There are polyfills <https://github.com/tc39/proposal-temporal?tab=readme-ov-file#polyfills> available that provide JS code that does implement the spec on any JS engine today, including V8 and JSC. If you're writing in C++, then you can also use the icu::TimeZone::getIanaID() <https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1TimeZone.html#ac6e93cddc71c33ae938580a839c8f543> function in the Unicode ICU library, combined with the enumeration function in the same class. I believe there's also a Java version of this API. Finally, you can get the data directly from CLDR here: https://github.com/unicode-org/cldr/blob/main/common/bcp47/timezone.xml. Make sure to use the iana attribute for each element so that you get the most up-to-date aliases instead of outdated ones like Asia/Calcutta or Europe/Kiev. BTW, this is the data source used in the ICU API above. Hopefully, one of these resources can be helpful for you. Thanks, Justin On Mon, Nov 3, 2025 at 10:13 AM Guillermo Rodriguez Garcia via tz < [email protected]> wrote: > Hi all, > > I'm building a TimeZone picker with the following constraints: > > 1. At least one distinct timezone per country (so that e.g. there is > an entry for Atlantic/Reykjavik instead of mapping IS to > Africa/Abidjan) > > 2. Within a country, do not show timezones that currently have > identical rules to another timezone in the same country (i.e. > historical differences don't matter). > > Because of (1) I started from zone.tab rather than zone1970.tab. > However, I'm not sure how to handle (2). > > For example, Spain has three zones in zone.tab: Europe/Madrid, > Africa/Ceuta, and Atlantic/Canary. But as far as most users are > concerned, as of today there are only two timezones in Spain: Madrid > and Canary Islands. Ceuta follows Madrid rules, so there should be no > need to show this as an option to the user. > > Another example: the U.S. lists 29 zones, but only 8 are distinct > today (ignoring historical changes). > > So, the question: Any suggestions on how to filter timezones within > each country to drop those that as of today are not relevant except > for historical differences? > > Thank you, > > Guillermo Rodriguez Garcia > [email protected] >
