
Ask HN: Is there a free list of cities mapped to their tz database time zones? - onesmalluser
For instance, Boston maps to &quot;America&#x2F;New_York&quot;, Amman, Jordan maps to &quot;Asia&#x2F;Amman&quot;, etc. https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;List_of_tz_database_time_zones#Legend
======
mtmail
We ([https://opencagedata.com/demo](https://opencagedata.com/demo)) return
that as part of our geocoding results. If you have only a couple of hundred
cities it's still within the free trial plan

    
    
            "timezone": {
              "name": "Asia/Amman",
              "now_in_dst": 0,
              "offset_sec": 7200,
              "offset_string": 200,
              "short_name": "EET"
            },
    

As detaro wrote the timezone-boundary-builder project is the best data source
for the shapefiles of timezones.

For a list of places the files on
[http://download.geonames.org/export/dump/](http://download.geonames.org/export/dump/)
have a column for the timezone name. Creative Commons Attribution 4.0 License.

There are places, usually unhabitated who don't have a good timezone name, but
just 'GMT-10' or such. With cities you likely don't encounter this. Short
names, e.g. EET, aren't unique. There are several who share the same
abbreviation.

------
detaro
One part of the puzzle are projects like this, giving you location to
timezone: [https://github.com/evansiroky/timezone-boundary-
builder](https://github.com/evansiroky/timezone-boundary-builder)

Mapping city to location is a classic geocoding task, for which there's APIs
and tools around.

