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.


In reply to Re^4: How to get client-side's localtime from the server-side by bart
in thread How to get client-side's localtime from the server-side by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.