m4uConcept
Programmer
Mybe anyone had this problem before or knows whats wrong whith the following code:
<script language='JavaScript'>
var calcDate = new Date(2003,9,15);
var ms = calcDate.getTime();
ms = ms + (12*24*60*60*1000);
calcDate.setTime(ms);
day = parseInt(calcDate.getDate(), 10);
month = parseInt(calcDate.getMonth(), 10)+1;
year = parseInt(calcDate.getYear() ,10);
hours = parseInt(calcDate.getHours() ,10);
minutes = parseInt(calcDate.getMinutes() ,10);
clickDateStr = day+"-"+month+"-"+
year+" "+hours+":"+minutes;
alert(clickDateStr);
</script>
the script adds 12 days to the 15-10-2003!
result on my pc: 26-10-2003 23:0
in my opinion the result must be 27-10-2003 0:0
with var calcDate = new Date(2003,8,15); everything works fine... hoping for help
Thx Roland
<script language='JavaScript'>
var calcDate = new Date(2003,9,15);
var ms = calcDate.getTime();
ms = ms + (12*24*60*60*1000);
calcDate.setTime(ms);
day = parseInt(calcDate.getDate(), 10);
month = parseInt(calcDate.getMonth(), 10)+1;
year = parseInt(calcDate.getYear() ,10);
hours = parseInt(calcDate.getHours() ,10);
minutes = parseInt(calcDate.getMinutes() ,10);
clickDateStr = day+"-"+month+"-"+
year+" "+hours+":"+minutes;
alert(clickDateStr);
</script>
the script adds 12 days to the 15-10-2003!
result on my pc: 26-10-2003 23:0
in my opinion the result must be 27-10-2003 0:0
with var calcDate = new Date(2003,8,15); everything works fine... hoping for help
Thx Roland