Results 1 to 2 of 2
Jan 10, 2013, 21:57 #1
Getting user's timezone based on IP address
Is there anyway we can get user's timezone based on their IP address without using a paid 3rd party service?
Jan 11, 2013, 05:21 #2
- Join Date
- Oct 2005
- Milton Keynes, UK
- 9 Post(s)
- 2 Thread(s)
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.