Y
yukabuk
Please look at the following code and run it.
<script type='text/javascript'>
var firstDate=new Date();
var tday=31;
var tmonth=4;
var tyear=2010;
firstDate.setDate(tday);
firstDate.setMonth(tmonth);
firstDate.setFullYear(tyear);
alert("First "+ tday + "/"+tmonth + "/"+tyear + " - " +
firstDate); //should this not say 31st and not the 1st?
var secondDate=new Date();
var tday=30;
var tmonth=4;
var tyear=2010;
secondDate.setDate(tday);
secondDate.setMonth(tmonth);
secondDate.setFullYear(tyear);
alert("Second "+ tday + "/"+tmonth + "/"+tyear + " - " +
secondDate);
</script>
Should the First date say 31st or May and not the 1st?
Am I missing something obvious?
Thanks
Graham Vincent
<script type='text/javascript'>
var firstDate=new Date();
var tday=31;
var tmonth=4;
var tyear=2010;
firstDate.setDate(tday);
firstDate.setMonth(tmonth);
firstDate.setFullYear(tyear);
alert("First "+ tday + "/"+tmonth + "/"+tyear + " - " +
firstDate); //should this not say 31st and not the 1st?
var secondDate=new Date();
var tday=30;
var tmonth=4;
var tyear=2010;
secondDate.setDate(tday);
secondDate.setMonth(tmonth);
secondDate.setFullYear(tyear);
alert("Second "+ tday + "/"+tmonth + "/"+tyear + " - " +
secondDate);
</script>
Should the First date say 31st or May and not the 1st?
Am I missing something obvious?
Thanks
Graham Vincent