Anyone know a site where I can enter a location and it'll tell me all these:

• IANA Time Zone Identifier (America/Los_Angeles)
• Legacy Country/Region Alias (US/Pacific)
• Specific Timezone Abbreviation (PST or PDT)
• Generic Timezone Abbreviation (PT)

Bonus points if it can convert between them.

I will also accept Python packages that convert between all these things.

@pganssle I figure you might have thoughts on this.

I'm trying to avoid making my own giant dictionary mapping just for my most common timezone mappings. 😅

Follow

@treyhunner Some of that stuff is probably not super easy to get. The mapping between location and zone is also probably surprisingly difficult given that that is almost certainly the best UX for users picking a time zone.

Here is an old Jupyter notebook I put together that makes a map of all zones: github.com/pganssle-talks/pyco

The mapping to the legacy zone thing won't have a canonical way to do it because that is not a defined thing, but there are like 4 of those so you can just do it yourself probably.

Not sure how to get the generic label in zones where it exists. Might be something in CLDR.

Lots of stuff in this general space on this page: data.iana.org/time-zones/tz-li

@treyhunner Oh and timeanddate.com has a ton of this stuff, they might already have what you want somewhere.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.