Closed Bug 278833 Opened 20 years ago Closed 20 years ago

javascript error when create object date

Categories

(Firefox :: General, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 22964

People

(Reporter: maurizio.romani, Assigned: bugzilla)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 i created object date and called the getYear() function; the year is wrong. Reproducible: Always Steps to Reproduce: use this html source code: <html> <script language=javascript> function SetDate(){ var data = new Date(); var gg; var mm; var aaaa; gg = data.getDate(); parseInt(gg) < 10 ? gg = "0" + gg : null; mm = data.getMonth()+1; parseInt(mm) < 10 ? mm = "0" + mm : null; aa = data.getYear(); document.form.DATA.value=gg+"/"+mm+"/"+aa; } </script> <body onLoad="SetDate()" > <form name=form> <input type=text name=DATA> </form> </body> </html> Actual Results: 105 Expected Results: 2005
getFullYear( ) Dup of Bug 22964 'JavaScript: getYear returns "100" for 2000'
Summary: javascript error when create object date → javascript error when create object date
*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Depends on: 1269117
No longer depends on: 1269117
You need to log in before you can comment on or make changes to this bug.