Closed
Bug 276567
Opened 20 years ago
Closed 20 years ago
The Date Object has an error.
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: liubingqian, Assigned: bugzilla)
Details
Today is Dec 31 2004,this code's result is Dec 31 104 now = new Date(); document.write((now.getMonth()+1)+" "+now.getDate()+" "+now.getYear());
Comment 1•20 years ago
|
||
This is actually correct behavior. You may instead want .getFullYear(). From the ECMA-262 specification: --- Date.prototype.getYear() This function is specified here for backwards compatibility only. The function getFullYear is much to be preferred for nearly all purposes, because it avoids the “year 2000 problem.” 1. Let t be this time value. 2. If t is NaN, return NaN. 3. Return YearFromTime(LocalTime(t)) - 1900. --- In this case, YearFromTime(LocalTime(t)) - 1900 = 104.
Comment 2•20 years ago
|
||
*** This bug has been marked as a duplicate of 58241 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Updated•20 years ago
|
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
Comment 3•20 years ago
|
||
*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•