Does anyone know what is wrong, that this script in this case, a bad number of days in the difference in dates? The difference should be 2 days - the script shows 1 day.
If the difference is in the same month is OK.
<script type="text/javascript">
var date_from = new Date(2012, 03, 31).getTime();
var date_to = new Date(2012, 04, 02).getTime();
document.write((date_to - date_from)/(1000*60*60*24));
</script>