views:

8585

answers:

5

Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?

A: 

Something like this?

Unsliced
+4  A: 

These look pretty promising-

http://www.earthtools.org/webservices.htm

chs
+10  A: 

Take a look at Geonames.org

It's a free webservice that allow you to get a lot of informations from a long/lat

They also provide a free (and open source) Java Client for GeoNames Webservices library (library for other language also provided: ruby, python, perl, lisp...)

Here's some info you can get from long/lat: (complete list of webservices here)

  • Find nearest Address
  • Find nearest Intersection
  • Find nearby Streets
  • Elevation
  • Timezone
Frederic Morin
this will give you the current time and the offsets for daylight savings and standard but I'm having trouble finding whether a date in the future is under Daylight savings
Scott Cowan
for that, the Java Calendar will probably be more usefull
Frederic Morin
+1  A: 

How much accuracy do you need? Dividing the longitude by 15 would almost be right :p

Tom
I was being pretty facetious when I made this answer, but not until I came across this question again when trying to solve the problem myself did I realise how totally useless the idea is: http://upload.wikimedia.org/wikipedia/commons/e/e7/Timezones2008.png (unless you're in international waters)
Tom
+2  A: 

There's a tutorial for getting the time zone from latitude and longitude using Google Maps and Geonames.org here: http://vancouverwebconsultants.com/getting-time-zone-from-latitude-longitude/

Fo