El lun, 3 nov 2025 a las 19:43, Justin Grant
(<[email protected]>) escribió:
>
> HI Guillermo - I think what you're looking for is the algorithm defined in 
> the JavaScript Internationalization (ECMA-402) specification. Specifically, 
> the 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 would actually need something similar to this, but instead of
removing "outdated intra-country links that have had the same time
history since 1970 as other zones", I would want to remove zones that
have the same rules for present and future times.

With the algorithm linked above I still get many zones where the only
differences are historical (for example Africa/Ceuta and
Europe/Madrid)

>
> 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.

Yes, I am using already ICU4J to detect zones for the same country and
which have identical rules for present and future times.

The only missing bit is, when I find such cases, which one wins :-)

>
> 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.

Yes, but this has the same problem: It lists zones which have
identical rules for present and future times and only differ in their
history (again: Africa/Ceuta and Europe/Madrid)

Thanks,

Guillermo Rodriguez Garcia
[email protected]

Reply via email to