views:

98

answers:

3

My script has as input the latitude and longitude values as GPS coordinates.

How can I get the current local time?

Are out there solutions that do not use databases or web services?

PHP has a method to retrieve location based on a timezone, I am wondering if the reverse exists or not

+1  A: 

Use this datafile. The data you are looking for is in zone.tab. wikipedia also has an overview of it - the table is generated from the datafiles.

Femaref
do you have code to parse the datafile?
Pentium10
+1  A: 

This question has been answered before. :-)

S..
A: 

geonames.org provide a range of webservices that can be used to get details from latitude and longitude. For example http://ws.geonames.org/timezone?lat=47.01&lng=10.2&style=full

You can just fetch that with your PHP code and parse the result.

See http://www.geonames.org/export/ws-overview.html for details of the available webservices.

john