Closed Bug 201531 Opened 22 years ago Closed 22 years ago

javascript interprets date wrongly

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 22964

People

(Reporter: manoharsingh, Assigned: norrisboyd)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312 <script language="JavaScript"> HoldDate=new Date(); document.write(HoldDate.getDate() + "/" + (HoldDate.getMonth()+1) + "/" + HoldDate.getYear()); </script> date should read (current day) / (current month) / (current year) 2003 (year) is read as 103. Reproducible: Always Steps to Reproduce: 1.use the script above 2. 3. Actual Results: year 2003 is read as 103. Expected Results: year must be read accurately
The getYear() method has been deprecated; use getFullYear() instead. That will work in any browser - For a history on how the spec changed on this, and how Microsoft and Netscape came to differ on getYear(), see bug 45764 comment 4. *** This bug has been marked as a duplicate of 22964 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Marking Verified. manohar: thank you for this report; this issue comes up from time to time -
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R5
Target Milestone: --- → 1.5R5
You need to log in before you can comment on or make changes to this bug.