Search code examples
phpgeolocationtimezonelatitude-longitude

Get PHP Timezone Name from Latitude and Longitude?


Is there a way get the timezone of a user by their latitude and longitude? And not just the offset, but the actual timezone they're in.

Essentially, I'm searching for the polar opposite of DateTimeZone::getLocation which returns the latitude and longitude for a certain timezone.


Solution

  • Geonames should do the job nicely:

    http://www.geonames.org/

    They've also got a php library.