
April 16th, 2008, 12:53 PM
|
 |
4:04 Time Not Found
|
|
Join Date: Jan 2004
Location: Northern Virginia
|
|
Put it in a function, and stop using language, aside from that it looks good..
Code:
<script type="text/javascript">
function dateDifference(startDate,endDate) {
startdate = new Date(startDate);
endDate = new Date(endDate);
difference = enddate - startdate;
days = Math.round(difference/(1000*60*60*24));
return days;
}
alert(dateDifference('4/16/2008','4/26/2008');
</script>
__________________
I am so smart, I am so smart, S.M.R.T ... I mean S.M.A.R.T.
Stop Using Pop-Ups
|