Closed
Bug 278833
Opened 20 years ago
Closed 20 years ago
javascript error when create object date
Categories
(Firefox :: General, defect)
Tracking
()
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
Comment 1•20 years ago
|
||
getFullYear( )
Dup of Bug 22964 'JavaScript: getYear returns "100" for 2000'
Summary: javascript error when create object date → javascript error when create object date
Comment 2•20 years ago
|
||
*** This bug has been marked as a duplicate of 22964 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•