Location based Timezone Retrieval

This depends on information the “location” contains? You’d somehow need to map the location to a timezone name, preferably the Olson style timezone names, because they are more detailed and easier to map, as they are locations themselves.

If it’s an approximate addres (like country and city or so) then several geolocation services do include timezones in their information, so you can call these services and see.

If it’s a geolocation with latitude and longitude then a site called Earthtools can give you the timezone. http://www.earthtools.org/webservices.htm#timezone

There is this database that provides mappings from cities and countries to timezones: http://citytimezones.info/cms/pending_requests.htm

Unfortunately it uses Windows timezone names, but you can this data http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml from Unicode.org to map between Windows timezone names and the Olson TZ names.

Leave a Comment