Y2K? Never heard of it...

M

McKirahan

The following is from RISKS-LIST: Risks-Forum Digest Sunday 26 December
2004 Volume 23 : Issue 63 archived at <http://www.risks.org>


Date: Thu, 23 Dec 2004 11:27:50 +0100
From: (e-mail address removed) (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
Subject: Y2K? Never heard of it...

According to www.lexpress.fr (the website of a leading French news
magazine), today's date is Jeudi 23 décembre 104. The date is generated by
the following snippet of ECMAScript:

var tj= new
Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var tm= new
Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","ao&u
circ;t","septembre","octobre","novembre","d&eacute;cembre");
d= new Date() ;
document.write( tj[d.getDay()] + " " + d.getDate() + " " +
tm[d.getMonth()] + " " + d.getYear()) ;

One wonders how long this has been so, and how much longer it will take
before they realize that they need to add 1900 to the year (and start
reading manuals).

Dag-Erling Smørgrav - (e-mail address removed)
 
J

Jan K.

McKirahan said:
The following is from RISKS-LIST: Risks-Forum Digest Sunday 26
December 2004 Volume 23 : Issue 63 archived at <http://www.risks.org>


Date: Thu, 23 Dec 2004 11:27:50 +0100
From: (e-mail address removed) (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
Subject: Y2K? Never heard of it...

According to www.lexpress.fr (the website of a leading French news
magazine), today's date is Jeudi 23 décembre 104.


Now it's Lundi 27 décembre 2004.
 
D

Dr John Stockton

JRS: In article <jnTzd.813955$8_6.313976@attbi_s04>, dated Mon, 27 Dec
2004 12:38:39, seen in McKirahan
According to www.lexpress.fr (the website of a leading French news
magazine), today's date is Jeudi 23 décembre 104. The date is generated by
the following snippet of ECMAScript:

One wonders how long this has been so, and how much longer it will take
before they realize that they need to add 1900 to the year (and start
reading manuals).

I was plausibly informed, in effect, that getYear() can also currently
return 4 in at least one system. In mine, it returns 2004.

If the magazine wishes to express the date of issue, they should write
it in the HTML, in French. It's not a magazine's job to do what almost
any digital watch will do and what any likely computer can easily show.

The simple solution is to use, currently, 2000+getYear()%100 and to
update that a couple of times per century. Another is to calculate the
Full Year from the value of the Date Object; a two-line function can do
it. Or to assume that getFullYear will exist.
 
M

McKirahan

McKirahan said:
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 <[email protected]>
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 <[email protected]>
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]
 
S

steven

[snip]
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]

aka "BCE" and "CE" resp.
"BC" and "AD" are christian oriented acronyms, and there's a (slow) shift
towards less biased naming.
(Christianity may be the largest religion in the world, but there's twice as
many non-christians than there are christians)
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated
Wed, 29 Dec 2004 05:34:28, seen in steven
[snip]
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]

aka "BCE" and "CE" resp.
"BC" and "AD" are christian oriented acronyms, and there's a (slow) shift
towards less biased naming.
(Christianity may be the largest religion in the world, but there's twice as
many non-christians than there are christians)


The terms BC & AD are used in ISO 8601:2000, and BCE & CE are not.
ECMA-262 does not use any of those, preferring formal ambiguity.
Implementations of javascript output, at least, A.D. & B.C., and accept
them and AD & BC; I've not heard of any that recognise CE and BCE in any
form.

One should not pander to anti-religious prejudices that attempt to deny
or conceal the true history of the world's main Calendar, and in
practice can only lead to confusion.
 
D

Douglas Crockford

One should not pander to anti-religious prejudices that attempt to deny
or conceal the true history of the world's main Calendar, and in
practice can only lead to confusion.

Right on. The citizens of the world must never forget that the month of
July was named for the Great Roman General, Emperor, and God Julius Caesar.

All Hail Mighty Caesar!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top