That is a good observation and probably a great way to auto-set a user's TZ setting but it only fixes half the "problem" some of the time. On a regular website (where you're not voting via POST constantly like here, most BB sites seem to take votes via GET) then you only get the post on login which happens maybe 1x daily or 1x 2 years.

Next is visitors who don't ever register. They never POST so the TZ will always be undetermined by the server but it will almost certainly be known by the client's machine; hence the need for client side something like JavaScript.

I'm not saying there's a wrong or right way to solve this, just trying to demonstrate what different users will see. Singapore users might get the right time, and whatever slice of Indonesia, etc is in the same TZ, but the other 23 TZs in the world will see datetimes out of sync with their own time. You just have to decide if this is important or not in your situation.

This is one I've considered for a site I'm working on and I will sheepishly admit that while I favor a client-side JS solution converting server side UTCs, I have yet to do the legwork to share the function() to do it. Maybe I've embarrassed myself into doing it today. :)

update: fixed bad paren, missing word, apostrophe.

update 2: well, I gave it a shot: Perl + JavaScript to display "correct" local times for datetimes. I'll give it a couple weeks of thought before I start using it in live stuff but I think I like it. Thanks for unintentionally prodding me to finally work on it.


In reply to Re^2: User's time by Your Mother
in thread User's time by kiat

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.