Alex Rivera | Logout

Location based Timezone Retrieval

Asked 2010-03-09T01:12:18.163
13

Given: LDAP stores location of users.

How do I drive their timezones using their location? Any pointers are accepted, Java language preferred.

Thanks in advance.

Edit
Report

1 Answer

8

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.

answered 2011-02-28T13:05:49.847

Your Answer