Closed Bug 161273 Opened 22 years ago Closed 20 years ago

Y2K bug when using dateobject.getYear

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 22964

People

(Reporter: reisilv, Assigned: rogerl)

Details

 
When using dateobject.getYear() for dates beyond year 2000 I got the result as
year-1900 instead of the full 4-digit year, what I should get according to the
Javascript reference guide.
This is not a bug. getYear() is deprecated and kept as-is to preserve backwards
compatbility.  Use getFullYear().

see comments in bug 22964, bug 45764, bug 58241, bug 65681, bug 82354 

*** This bug has been marked as a duplicate of 100123 ***

*** This bug has been marked as a duplicate of 100123 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
As a note, getYear() is no longer in the JavaScript standard... 
Marking Verified -

Reinaldo, thank you for this report. The solution is to use
.getFullYear() instead of getYear().

For a history on how the ECMA standard changed on this subject,
and how Netscape and Microsoft came to differ on the behavior
of .getYear(), see bug 45764.
Status: RESOLVED → VERIFIED
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---

*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.