Jan 1, 3900???..where did that come from.greenspun.com : LUSENET : TimeBomb 2000 (Y2000) : One Thread |
One of the largest genealogy websites "Ancestry Hometown" is showing a date of Jan 1, 3900. How on earth did this get posted and what is the logic behind the error?...is there any?http://www.ancestry.com/
-- Laurane (familyties@rttinc.com), January 01, 2000
Looks like this is where it came from:function dateString(oneDate) { var theMonth = monthNames[oneDate.getMonth() + 1] var theYear = oneDate.getYear() + 1900 return theMonth + " " + oneDate.getDate() + ", " + theYear
2000 + 1900 = 3900. Funny how that works.
-- =DSA. (dsangal@attglobal.net), January 01, 2000.
Oops, sorry about the formatting. One more time:function dateString(oneDate) { var theMonth = monthNames[oneDate.getMonth() + 1] var theYear = oneDate.getYear() + 1900 return theMonth + " " + oneDate.getDate() + ", " + theYear }
Looks to me like oneDate.getYear() returns 2000, not 100 (which appears to be what the coder was expecting).
-- =DSA. (dsangal@attglobal.net), January 01, 2000.
Here is the site for the U.S. Naval Observatory. It also has the year as 3900.
-- shari (shari_h72@hotmail.com), January 01, 2000.
sorry! :)http://aa.usno.navy.mil/AA/data/docs/RS_OneDay.html
-- shari (shari_h72@hotmail.com), January 01, 2000.
Oh, fer cryin' out loud.* function dateString(oneDate) { * var theMonth = monthNames[oneDate.getMonth()+1] * var theYear = oneDate.getYear()+1900 * return theMonth+" "+oneDate.getDate()+", "+theYear * }
Sheesh.
-- =DSA. (dsangal@attglobal.net), January 01, 2000.
Hey, don't mind me . . . I just want to use up some bandwidth and resources until I get this right. =8^b
function dateString(oneDate) { var theMonth = monthNames[oneDate.getMonth() + 1] var theYear = oneDate.getYear() + 1900 return theMonth + " " + oneDate.getDate() + ", " + theYear }
-- =DSA. (dsangal@attglobal.net), January 01, 2000.
I have seen the date "3900" on many sites today. Not that it matters, but it has been amusing.
-- semper paratus (happy@new.year), January 01, 2000.
3900 date also seen at www.albuquerquetribune.com today, 01/01/00, along with lots of reports on how nothing happened, all is well in area, state, country...
-- Debby (Debbynospam@swcp.com), January 01, 2000.
In early browsers, the JavaScript getYear function returs a 2 digit year, and 100 for year 2000. Newer browsers return a 2 digit year through 1999, then return a 4 digit year after 2000. The early way to go from 2 digits to 4 was to add 1900. But, to be compatibel with all browsers, the proper technique must check the value returned by getYear to see if it is a 2 digit or 4 digit value, and ojnly adding 1900 to 2 digit values.
-- nobody (nobody@nowhere.com), January 01, 2000.