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!
Google provides an API for this.
https://maps.googleapis.com/maps/api/timezone/<json or xml>?location=<lat>,<lng>×tamp=<unix timestamp>&sensor=<true or false>
eg:
https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510×tamp=1331161200&sensor=false
http://www.geonames.org/ provides an API that returns the timezone given a lat/lng
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With