tags:

views:

17

answers:

1

I need to get the time zone for a given address/location. Assume that the address/location can be reverse geocoded (using google) to a lat/lng if necessary.

This means that I may not have a zip code.

I was really hoping that google provided some kind of API for this, but it seems that they don't. At a minimum you can google search for "time in washington, dc" and get the time/TZ -- but then I'd have to screen scrape that which is not fun :(

I know there are databases available that map locations to time zones, but that'd have to be maintained. Has anyone come up with a tricky solution to this problem?

Thanks!

A: 

The question needs to be clarified a bit more. What are you doing this for? What language(s) are you using? But how I would approach the problem is: First, create a table like structure that translates longitudes into zones(much like this table ). Next I would query the GMT either locally, or on the web somehow, and finally take the offset from the table and add it to GMT. This way there is no "maintenance" of the table since these longitudes don't change.

mpd