Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lon,lat to timezone

Does anyone know if there is any existing solution for determining a timezone from a point (lon, lat)?

i could hard code the few i need for this project but it'd be better to use a pre-built solution.

thanks.

like image 823
pstanton Avatar asked Dec 09 '25 12:12

pstanton


1 Answers

Use a webservice such as the one provided by geonames.

Example:

http://api.geonames.org/timezone?lat=47.01&lng=10.2&username=demo

Returns:

...
<timezoneId>Europe/Vienna</timezoneId>
...
like image 170
moinudin Avatar answered Dec 11 '25 01:12

moinudin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!