Date object returns wrong year when calling getYear methode

RESOLVED DUPLICATE of bug 22964

Status

()

--
major
RESOLVED DUPLICATE of bug 22964
14 years ago
14 years ago

People

(Reporter: j_hemelt, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041107 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041107 Firefox/0.9.1+

If you create a Date object for the current date and call the getYear method the
method returns 104 instead of 2004.

Reproducible: Always
Steps to Reproduce:
1.Open Javascript Console
2.Enter following code: x = new Date(); x.getYear();
3.Press "evaluate"

Actual Results:  
The displayed result is "104".

Expected Results:  
The software should return the current year, in this case "2004".

Comment 1

14 years ago
You should use getFullYear(), not getYear.

*** This bug has been marked as a duplicate of 100123 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE

Comment 2

14 years ago
v
Status: RESOLVED → VERIFIED
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---

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