Closed Bug 100123 Opened 23 years ago Closed 20 years ago

today.getYear() returns "101"

Categories

(Core :: JavaScript Engine, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 22964

People

(Reporter: davidy, Assigned: rogerl)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.4) Gecko/20010913
BuildID:    2001091303

Code below

document.write(WhichDay[today.getDay()]+","+WhichMonth[today.getMonth()]+""+today.getDate()+",
"+today.getYear());

yields

Monday, September 17, 101


Reproducible: Always
Steps to Reproduce:
load page

Actual Results:  Year is "101"

Expected Results:  Year is "2001"
This is expected behavior for backward compatibility with Netscape 4.x. You
should use today.getFullYear() instead. getFullYear returns the 4-digit year as
desired.

Marking invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
See bug 45764 and bug 22964 for more details about the results from getYear in
4.x and mozilla. (Summary: getYear is depreciated in ECMA-262 and only
getFullYear is necessary for compliance. Since getYear was returning 101 for
2001 as of 4.06, they decided to keep this behavior.)

Marking Verified -

Thank you for this report. Please continue to use Bugzilla;
we depend on contributors like you to catch the things we miss -
Status: RESOLVED → VERIFIED
*** Bug 114401 has been marked as a duplicate of this bug. ***
*** Bug 115264 has been marked as a duplicate of this bug. ***
*** Bug 129662 has been marked as a duplicate of this bug. ***
*** Bug 131280 has been marked as a duplicate of this bug. ***
*** Bug 133435 has been marked as a duplicate of this bug. ***
*** Bug 142496 has been marked as a duplicate of this bug. ***
*** Bug 153229 has been marked as a duplicate of this bug. ***
*** Bug 155995 has been marked as a duplicate of this bug. ***
*** Bug 161273 has been marked as a duplicate of this bug. ***
*** Bug 175253 has been marked as a duplicate of this bug. ***
*** Bug 180587 has been marked as a duplicate of this bug. ***
*** Bug 192241 has been marked as a duplicate of this bug. ***
*** Bug 236186 has been marked as a duplicate of this bug. ***
*** Bug 251437 has been marked as a duplicate of this bug. ***
*** Bug 251568 has been marked as a duplicate of this bug. ***
*** Bug 251568 has been marked as a duplicate of this bug. ***
*** Bug 261399 has been marked as a duplicate of this bug. ***
*** Bug 268361 has been marked as a duplicate of this bug. ***
*** Bug 268833 has been marked as a duplicate of this bug. ***
*** Bug 279128 has been marked as a duplicate of this bug. ***
Status: VERIFIED → UNCONFIRMED
Resolution: INVALID → ---

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