"McKirahan" <Ne**@McKirahan.com> wrote in message
news:jnTzd.813955$8_6.313976@attbi_s04...
The following is from RISKS-LIST: Risks-Forum Digest Sunday 26 December
2004 Volume 23 : Issue 63 archived at <http://www.risks.org>
[snip]
Here are follow ups from RISKS-LIST: Risks-Forum Digest Tuesday 28 December
2004 Volume 23 : Issue 64:
Date: Sun, 26 Dec 2004 18:06:08 -0500
From: Scott Nicol <sn****@apk.net>
Subject: Re: Y2K? Never heard of it... (DES, RISKS-23.63)
This is one of those little problems that never should have been a problem.
It was a bad design, but the subsequent fixes created the problem. It
appears that lexpress.fr tests their site using Internet Explorer, since the
year will display correctly with this browser.
date.getYear() is supposed to return "year - 1900", so if you want to
display
"1999", you should add 1900 to date.getYear() before displaying it.
However, many lazy programmers displayed the date using the string "19" and
tacked on the result of date.getYear(). On January 1 2000, many web sites
showed the year as "19100".
Recognizing the problem, Netscape added date.getFullYear() in javascript 1.1
(but their documentation says it was added in 1.3), which returns the full
year. However, nobody wanted to use it because not every browser in use
supported it (even now, but especially in 2000).
Microsoft also recognized the problem, and "fixed" date.getYear() by making
Internet Explorer return 99 in 1999, but 2000 in 2000, breaking
compatibility
with almost every other browser. It would be easy to blame Microsoft for
this, except that Netscape itself made this same "fix" in some (but not all)
versions of navigator 3.
So for the first week of 2000, various web sites displayed 2000, 19100,
3900, 20100, 192000, 202000, or nothing, depending on what browser you were
using and how the code was written (and rewritten, again and again, as
different browser users complained).
The correct fix is to call date.getYear() and add 1900 to it if the result
is less than 1999. You won't find that in any reference manual, however.
------------------------------
Date: Sun, 26 Dec 2004 21:49:11 GMT
From: Ray Blaak <rA******@STRIPCAPStelus.net>
Subject: Re: Y2K? Never heard of it... (DES, RISKS-23.63)
And how much longer will it take before broken libraries finally stop having
getYear() return such unintuitive results?
It is not a precision problem.
The only "zero" year should be 0 BC/AD, and nothing else.
[Quite correct, even though there WAS NO ZERO YEAR. Whoever decided
on the BC to AD shift was certainly not a mathematician. PGN]