[tz] Timezone in Brazil
guy at alum.mit.edu
Sun Oct 11 03:00:32 UTC 2015
On Oct 9, 2015, at 9:22 PM, Random832 <random832 at fastmail.com> wrote:
> Matt Johnson <mj1856 at hotmail.com> writes:
>> TZDB doesn't track display names. This is the realm of CLDR.
> Since no-one ever bothers to explain *how* the CLDR does it, this is
> what I've been able to figure out.
> The user having selected Brazil from a list of countries,
Even if you don't have a "get the location of the machine and set it based on that" option, the UI doesn't necessarily have to involve selecting a country from a list of countries.
As per my other recent mail, OS X lets you shut off the "get the location of the machine and set it based on that" option; if you do that, it gives you a map that you can click on, in addition to a combo box from which you can select a city (the list of cities is based on the location you've clicked on in the map) or type in an arbitrary city. The drop-down list in the combo box has all cities that begin with the sequence you've typed so far, so you can, for example, choose between Glendale, Arizona and Glendale, California - or between London, United Kingdom and London, Canada.
No need to select the country.
However, if you can't provide a list of cities for whatever reason (including "it's a simple text-based UI and supporting that would be too complicated"), you might have to go through a country/zone name within that country selection menu.
It might be possible to use the territory supplemental information:
to get a list of countries, and use the main files to get the localized names for the countries.
Unfortunately, there doesn't seem to be any obvious way to get a list of tzids for a country, which is the list you'd want
> you need to get, somehow, a list of all metazones that apply to Brazil.
* At any given point in time, each zone belongs to no more than one metazone.
* At a given point in time, a zone may not belong to any metazones.
* Except for daylight savings, at any given time, all zones in a metazone have the same offset at that time."
The second of those invariants means that getting a list of metazones would not be sufficient - the most appropriate zone for some user might not *be* in any metazone.
The ideal time zone selector would need information from the CLDR *and* some additional information, such as boundaries of tzdb zones and lists of cities. I'm not sure how much of the additional information can, or should, be provided as part of the tzdb itself. I'm also not sure how much of it can, or should, be provided by the CLDR.
For what it's worth, here:
is a shapefile that "captures the boundaries of the TZ timezones across the world, as of TZ 2013b". There might also be useful information available from geonames.org and openstreetmap.org.
But if you're stuck with presenting a list of "time zones" from which to select, that might require yet another database. I'm not sure whether that'd be in the scope of the tzdb or the CLDR or neither of them - and for some locations, the appropriate tzdb zone might not really have a good name, other than what it's called now or "XXX time" if it's shuffled between differently named zones or is one of those "XXX time except that we don't do DST" zones.
More information about the tz