Y2K? Never heard of it...
|
|
Thread rating:  |
McKirahan - 27 Dec 2004 12:38 GMT 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: des@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évrier","mars","avril","mai","juin","juillet","ao&u circ;t","septembre","octobre","novembre","dé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 - des@des.no
Jan K. - 27 Dec 2004 14:46 GMT > The following is from RISKS-LIST: Risks-Forum Digest Sunday 26 > December 2004 Volume 23 : Issue 63 archived at <http://www.risks.org> [quoted text clipped - 5 lines] > 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.
Lee - 27 Dec 2004 16:03 GMT Jan K. said:
>> The following is from RISKS-LIST: Risks-Forum Digest Sunday 26 >> December 2004 Volume 23 : Issue 63 archived at <http://www.risks.org> [quoted text clipped - 7 lines] > >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.
Dr John Stockton - 28 Dec 2004 15:23 GMT 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 <News@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.
 Signature © 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.
McKirahan - 28 Dec 2004 20:23 GMT > 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 <snicol@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 <rAYblaaK@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]
Randy Webb - 28 Dec 2004 23:15 GMT <--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.
 Signature Randy comp.lang.javascript FAQ - http://jibbering.com/faq
steven - 29 Dec 2004 05:34 GMT [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)
Dr John Stockton - 29 Dec 2004 15:40 GMT JRS: In article <ElrAd.13072$Ug6.972901@phobos.telenet-ops.be>, dated Wed, 29 Dec 2004 05:34:28, seen in news:comp.lang.javascript, steven <stevenPANTSvh@pandora.be> posted :
>[snip] >> The only "zero" year should be 0 BC/AD, and nothing else. [quoted text clipped - 7 lines] >(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.
 Signature © 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.
News Me - 29 Dec 2004 20:14 GMT <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
Douglas Crockford - 30 Dec 2004 16:42 GMT > 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!
|
|
|