Advertisements
hi, I was actually working on to calculate the number of days between two dates of dd/mm/yyyy format using javascript. can anyone suggest me how to work it outin calculating the difference between the two dates
<script> var oneDay = 24*60*60*1000; var firstDate = new Date(2012,04,24); var secondDate = new Date(2012,04,26); var days = Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay)); document.write("Number of days: "+days); </script>