Closed
Bug 65681
Opened 25 years ago
Closed 20 years ago
time.getYear() returns wrong year
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: ajp+mozilla, Assigned: rogerl)
References
()
Details
Go to http://www.neu.edu in Mozilla (Linux), and look at the date. instead of
year 2001, it shows year 3901..?? Looks like a bug time.getYear(). I have
reports that this works on a Mac in IE.
Nope, time.getYear() works fine.
The problem with this site is that it checks if the user-agent is 'Netscape' and
if so, adds 1900 to time.getYear() before displaying it, as below:
...
if (navigator.appName == "Netscape")
year=1900 + year;
...
Don't know why.Perhaps in response to some Y2K bug in an older version of
Netscape? Clumsy way of doing it.
If so, I suppose this might go to Evangelism. Otherwise, Invalid.
| Reporter | ||
Comment 2•25 years ago
|
||
Yeah, i guess.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Comment 3•25 years ago
|
||
The use of Date.getYear() was deprecated in favour of .getFullYear()
(which returns the full four-digit value for the year). See bug 22964
for further information on this -
Verifying Invalid -
Status: RESOLVED → VERIFIED
*** Bug 123433 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Status: VERIFIED → REOPENED
Resolution: INVALID → ---
Comment 5•20 years ago
|
||
*** This bug has been marked as a duplicate of 22964 ***
Status: REOPENED → RESOLVED
Closed: 25 years ago → 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•