SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Getting user's timezone based on IP address

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    May 2008
    Posts
    591
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question 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

  2. #2
    SitePoint Guru TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    960
    Mentioned
    8 Post(s)
    Tagged
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •