How to get timezone by IP

Happy picture Happy · Feb 17, 2014 · Viewed 11.4k times · Source

I have a registration by which i can get the IP address of user who registers.

I want to get the timezone of user by his IP address.

Like in jquery we can get like this Timezone in jquery

How can i do it in PHP.

Answer

Jayendra picture Jayendra · Feb 17, 2014

You can use GeoIP based services http://www.php.net/manual/en/book.geoip.php

Or

You can use online services that gives timezone of the IP that you supply in request

i.e.

$tags = get_meta_tags('http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress=94.55.180.139'); 
echo $tags['timezone'];