Closed Bug 268361 Opened 20 years ago Closed 20 years ago

Date object returns wrong year when calling getYear methode

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 22964

People

(Reporter: j_hemelt, Unassigned)

Details

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".
You should use getFullYear(), not getYear. *** This bug has been marked as a duplicate of 100123 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
v
Status: RESOLVED → VERIFIED
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.