In most cases, we want an IANA/Olson time zone identifier, although some services return only a UTC offset or another type of identifier.
Time zone web services
- Google Maps Time Zone API
- Bing Maps Time Zone API
- Azure Maps Time Zone API
- GeoNames Timezone API
- API TimeZoneDB
- AskGeo — a commercial service (but , possibly more accurate than GeoNames )
- GeoGarage Time Zone API — a commercial service focused on nautical time zones.
Raw time zone boundary data
- Timezone Boundary Builder — generates time zone shapefiles from OpenStreetMap data, including territorial waters near coastlines.
The following projects previously supplied time zone boundary data but are no longer actively maintained.
- tz_world — Eric Muller's original shapefile data
- whereonearth-timezone — a GeoJSON version with WOEDB data merged in
Offline time zone geolocation implementations
Implementations using Timezone Boundary Builder data
- node-geo-tz — a JavaScript library for Node.js only
- timespace — a JavaScript library
- tz-lookup-oss — a JavaScript library
- GeoTimeZone — a .NET library
- Geo-Timezone — a PHP library
- timezonefinder — a Python library
- ZoneDetect — a C library
- Timeshape — a Java library
- TimeZoneMap — a library for Java and Android
- lutz — an R library
- go-tz — a Go library
- Timezone lookup — a Go library
- docker-timezone-lookup — a Docker container wrapping node-geo-tz
Implementations using older tz_world data
- latlong — a Go library (also read this post .)
- TimeZoneMapper — a Java library
- tzwhere — a JavaScript/Node library
- pytzwhere — a Python library
- timezone_finder — a Ruby library
- LatLongToTimeZone — Java and Swift libraries
- What time is it here? — a blog post describing PHP and MongoDB
- rundel/timezone — an R library
Libraries that call a web service
- timezone — a Ruby gem that calls GeoNames
- AskGeo provides its own client libraries for Java and .NET.
- GeoNames provides client libraries for almost everything.
Self-hosted web services
- geo2tz — based on time zone lookup, available as a Docker image.
Other ideas
- Find the nearest city using an R-tree
- Find the nearest city using MySQL
The nearest-city method may provide only an approximation rather than the “correct” result.