Getting user's timezone based on IP address

Hi

Is there anyway we can get user’s timezone based on their IP address without using a paid 3rd party service?

Thanks

You’ll need a geoip database. However, they’re not entirely accurate so you’re best off simply asking the user what time zone they’re in.

A crude method would be to do a reverse dns lookup on their IP and do some tracing to work out where they are… either check the domain for a country code or do a whois lookup on the domain (Their ISP) and see where they’re based. Of course, finding the country won’t be useful for countries that span multiple time zones.