Well, you will see 2006-01-01 6:00am (Japan TZ), You will convert it to epoch number in that TZ... When people in Japan look the register and will see 2006-01-01 6:00am, but the guys in US will see 2005-12-31 6:00pm (US TZ). Looking by one side, it's correct, because 2006-01-01 6:00am on Japan really was 2005-12-31 6:00pm in US, but that can cause a HUGE confusion...

I agree with you that storing the local timezone of an event along with the event is a good idea: it can yield some useful additional information about the event. But what's far more important is the time when the event actually occured. You can store enough information to know both the local time and the normalized time if you want but by default you should present information about the normalized time to the user since times that may or may not be in the user's local timezone are useless for knowing when an event occured. I disagree that your example could cause HUGE confusion. In fact, I think that your proposal can cause HUGE confusion! If different users in the accounts department in different local timezones entered several transactions in the same day, how can you make sense of what happened in what order unless the times are all presented in the same time zone (be it the local timezone for you, the observer, UTC, or any other chosen timezone)? What about triggered events that automatically occured on the account. What timezone should they be presented in, if not the same, normalized, timezone as everything else?

Maybe I've dealt with too many trouble tickets involving a customer, a callcentre, myself, all in different timezones, with the trouble itself being on a WAN spanning multiple timezones, and the monitoring systems not all in the same time zone, but I have a great need to have information presented to me in a standard timezone in order to make sense of any of it!

Not everyday has 24 hours, some have 23 and some have 25... so adding 86400 seconds is not really increasing one day...

I think you are talking about daylight savings time. I hope you are lucky enough to live in an area that does not practice this stupid ritual because it causes problems no matter what you do. If you use "epoch numbers" then adding 86400 may give you a different time of day on the next day however it is guaranteed to give you the time 24 hours away. On the other hand when using a time format like ISO8601 you can do arithmetic on the date portion (carefully, because of leap years and such), but adding one to the hour may yield an impossible, ambiguous, or duplicate time.


In reply to Re^2: Year 2038 by Celada
in thread Year 2038 by InfiniteLoop

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.