in reply to Re^3: How to get client-side's localtime from the server-side
in thread How to get client-side's localtime from the server-side

it's important to understand that it's a heuristic and not a real concrete method.
I would never call it a heuristic since it makes use of a database lookup. The database can be huge. By contrast, a heuristic makes a guess based on (very) limited info.

If you use Geo::IP you can use the free though somewhat limited database, or, if you want a better precision — and likely, fewer errors, then you can pay for a bigger, commercial database from the same company who brought you the module.

n.b. I see that for the latter they require you need to be an "established business". That may be out of the reach of many developers here who may be wanting to use it for their own little projects.

Personally I think I'd go for the Lite version, and give the user the option to correct the guessed time zone, possibly making use of Javascript to automate it, for people who have Javascript enabled for your site.

  • Comment on Re^4: How to get client-side's localtime from the server-side

Replies are listed 'Best First'.
Re^5: How to get client-side's localtime from the server-side
by kyle (Abbot) on Aug 06, 2007 at 16:44 UTC

    I think we agree on how geolocation by IP works and that it has faults, just not on whether to call that a "heuristic".

    I'm not familiar with where those databases get their information, but unless they're somehow tracking users in real time, there's bound to be faults. When I VPN from New York to my closet in Chicago, there isn't any way for the database to know that. People travel and networks tunnel, and that's leaving aside users of things like Tor who've deliberately taken steps to hide who and where they are.

    There are lots of ways to guess, some better than others, but not really any way to know.