• Random832 (unregistered) in reply to jspenguin
    Converting time zones should be handled by the application that actually displays the time, not by the system that actually keeps the time. Almost all modern operating systems do this except Windows. <rant>I hate that stupid dialog saying "Windows has updated your clock for Daylight Saving Time". It shouldn't have to update it! The clock on the taskbar should reference the current time in UTC with the timezone definition file, and adjust the display time itself, like xclock and every other Unix program that displays the time.</rant>

    Windows hasn't been like that since Win95; it's just like any other operating system now.

    And the dialog box is so that users don't think they have to update it, and for that it doesn't really matter if what actually happened was "the system clock was changed" or "the offset used from the system clock to local time is now different", dumb users need to be told this regardless.

    John Muller:
    (1900)+(107) numerically gives 2007... if it were erroniously treated as a string "1900" + "107" should have given "1900107"...

    Try "19"+"107". As in, you know "19"+"99".

    I think I can make some guesses from here.

    In the Javascript standard, getYear() returns 98, 99, 100, 101 - you are supposed to add 1900 numerically. On IE, getYear() returns 97, 98, 99, 2000, 2001, 2002. (They can't be blamed, necessarily, because the standard used to do this)

    One "obvious" solution in the IE situation (which would also apply to netscape 4) is if(year<2000)year="19"+year

    Now, what is the correct answer?

    If you said "if(year<2000) year = 1900+year", you are WRONG. the correct answer is to use getFullYear().

Leave a comment on “Slowing Time”

Log In or post as a guest

Replying to comment #:

« Return to Article