Remix.run Logo
umanwizard 3 days ago

Europe/London is one of the names of a time zone, yes (variously also called Europe/Lisbon, WET, etc.). But what about for cities that don’t have a canonical name in tzdb? You can’t just always do Continent/City; America/Tucson, for example, does not exist.

kelnos 3 days ago | parent [-]

That's not how those named zones work. I live in San Francisco, but my TZ is America/Los_Angeles. You don't need a named zone for every city; you can just pick a large city in the region where time is and always has been the same.

If SF decided to drop DST, but the rest of the state didn't[0], then America/San_Francisco would be created to handle the changes.

This is why you can't accurately record physical appointments by date, time, and timezone. You have to record it as date, time, and physical location, and then the time zone can "float", based on the location and rules in the tzdb, until the appointment happens.

[0] Assuming this were made legal, which is pretty unlikely.

umanwizard 3 days ago | parent [-]

I think you’re agreeing with me. My point was that the tzdb named zones do not provide a generally accepted way to denote “the time in Tucson” or “the time in San Francisco” that would be robust to those splitting from Phoenix or LA, respectively. You need to use some system other than tzdb named zones for that purpose (e.g. lat/long, like you mentioned).