Closed Bug 340299 Opened 18 years ago Closed 18 years ago

Y2K Bug in Javascript when using getYear() Function

Categories

(Firefox :: General, defect)

Other
Other
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 22964

People

(Reporter: dirk, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Build Identifier: 1.5.0.7

When using the getYear() function from a document date, you recieved a not y2k save result. This line:

d=new Date(document.lastModified).getYear()

returns 106 in javascript console (and of corse in web). The IE returns 2006.
I solved the problem in my website with %100+2000. 

Reproducible: Always

Steps to Reproduce:
1.javascript console
2.d=new Date(document.lastModified).getYear()
3.evaluate

Actual Results:  
106

Expected Results:  
2006

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