[tz] Converting cities to tz identifiers (tangent)
jhawk at MIT.EDU
Tue Feb 20 17:46:28 UTC 2018
This is a bit of a rambling tangent, so sorry.
I recently had to find tz zones for ~100 American cities, and the process did not go quite as smoothly as I had expected.
I figured that a review of theory.html and tz-link.html would tell me the best way to do this, and it didn't really work out that way.
The result was that I found myself just reading the "northamererica" file and knocking out the states that were unambiguous, and then checking the rest against timeanddate.com or time.is. It seems wrong that this appeared to be the easiest approach at this scale, so I wonder what others would suggest (with the benefit of hindsight).
And then, in most cases, converting the zones via "backward" to the "US/Eastern" American political because doing so seemed more "stable."
* I was expecting theory.html to give me a little more guidance on the "right" way to do this. As best as I can tell, the "right" (no pun intended) answer is that I should geolocate each city to longitude/latitude (using some unspecified resource, which seems fine), then use one of the datasets or tools at https://data.iana.org/time-zones/tz-link.html#boundaries to convert those locations to zones. This seemed a bit much.
* I was also a little surprised to not find someone with a handy list of United States states and territory mappings to tz identifiers (for those cases where the state/territory/district uniquely mapped to a tzid). Other than the comments in "northamerica" (which are not quite as structured as one might like, but are pretty good).
* Then I was faced with the question of what the most stable identifier to use was. For instance, take Boston, Massachusetts. I could record it as America/New_York, or as US/Eastern. For instance, at some point in the future, either Boston or New York might exit the Eastern time zone. Cases:
Case 1: If that New York exited and Boston didn't, picking US/Eastern would clearly be the more stable choice.
Case 2: And if Boston exited and New York didn't, it wouldn't matter which I chose, I'd have to update my mapping when Boston moved.
Case 3: If New York and Boston both exited US/Eastern and went the same way, then America/New_York would be the better choice.
Case 4: If New York and Boston both exited US/Eastern and did different things, it's not clear which is the better choice, but similar to Case 2.
Lather rinse repeat for 50 states + some territories and DC.
My conclusion was that in general, for most locations, the US/* ("backward") form seemed the better choice.
(Both Massachusetts and Florida seem to have current proposals to depart US/Eastern and America/New_York.)
* So, I'm curious if this anecdote triggers any reactions.
Did I miss an obvious way to address this more simply?
Is it horrible to have made use of third party websites that lack any sort of auditable authority but are probably correct anyhow.
Is this just not a problem that people have to solve with any frequency?
Does someone (Paul?) want to convince me that it's Wrong to use the "backward" zones, for the narrow (but common) case of United States of America cities?
Thanks for any thoughts.
--jhawk at mit.edu
More information about the tz