this takes care of dates in the month, including leap years etc
<script>
var oDate_1 = new Date( 2003, 5, 15 )
var oDate_2 = new Date( 2003, 6, 12 )
iTime_1 = oDate_1.getTime();
iTime_2 = oDate_2.getTime();
iDiff = Math.abs( iTime_1 - iTime_2 );
alert( iDiff / 86400000 ) // 1000ms * 60secs * 60mins * 24hours = 1 day)
</script>
Main Topics
Browse All Topics





by: CajonesPosted on 2003-07-17 at 06:57:53ID: 8942681
<script>
[0]*365)+p arseInt(da te1d[1]*30 )+parseInt (date1d[2] )
[0]*365)+p arseInt(da te2d[1]*30 )+parseInt (date2d[2] )
l)
// yr m d
date1="1982-11-23"
date2="1983-11-23"
date1d=date1.split("-")
date1total=parseInt(date1d
date2d=date2.split("-")
date2total=parseInt(date2d
alert(date2total-date1tota
</script>
you will need to write some code to find out exactly how many days are in each different month, but you get the idea