is there any possibility to determine the timezone of point (lat/lon) without using webservices? Geonames.org is not stable enough for me to use :( I need this to work in PHP.
Thanks
We must start by finding the difference in longitude (or degrees) of the two places. We do this by adding the two numbers. Then, divide by the 15 degrees that occurs in one hour and this will give you the time difference between two locations through the International Date Line.
The rotation of the Earth means that time zones are dictated by the lines of longitude connecting the two poles.
I had this problem a while back and did exactly what adam suggested:
IIRC it took less than 1 second to populate the R-Tree, and it could then perform thousands of lookups per second (both on a 5 year old PC).
How exact do your results have to be? If a rough estimate is enough, calculate the offset yourself:
offset = direction * longitude * 24 / 360
where direction is 1 for east, -1 for west, and longitude is in (-180,180)
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