HI Guillermo - I think what you're looking for is the algorithm defined in the JavaScript Internationalization (ECMA-402) specification. Specifically, the
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 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() 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.
Hopefully, one of these resources can be helpful for you.
Thanks,
Justin