By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,042 Members | 1,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,042 IT Pros & Developers. It's quick & easy.

Y2K? Never heard of it...

P: n/a
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: de*@des.no (=?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","m ai","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 - de*@des.no
Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
McKirahan wrote:
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: de*@des.no (=?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.
Jul 23 '05 #2

P: n/a
Lee
Jan K. said:

McKirahan wrote:
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: de*@des.no (=?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.


IE shows the year as 2004, but browsers that implement getYear() correctly still
show it as 104.

Jul 23 '05 #3

P: n/a
JRS: In article <jnTzd.813955$8_6.313976@attbi_s04>, dated Mon, 27 Dec
2004 12:38:39, seen in news:comp.lang.javascript, McKirahan
<Ne**@McKirahan.com> posted :
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.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #4

P: n/a
"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]
Jul 23 '05 #5

P: n/a
McKirahan wrote:
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:jnTzd.813955$8_6.313976@attbi_s04...

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


Don't let the Astronomers know that there was no Zero Year.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #6

P: n/a
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:whjAd.274877$V41.144653@attbi_s52...

[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)
Jul 23 '05 #7

P: n/a
JRS: In article <El********************@phobos.telenet-ops.be>, dated
Wed, 29 Dec 2004 05:34:28, seen in news:comp.lang.javascript, steven
<st***********@pandora.be> posted :
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:whjAd.274877$V41.144653@attbi_s52...

[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.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #8

P: n/a
Dr John Stockton wrote:
<snip>

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.


Don't you mean "anti-Christian prejudices". As a segment of the
population who practice a religion in some form, Christians are a minority.

NM
Jul 23 '05 #9

P: n/a
> 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!
Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more JavaScript / Ajax / DHTML Questions on Bytes