The form below has two fields containing a date. Click the "Calculate Difference" link to calculate the difference in minutes.
<form id="pirep" runat="server">
Start Time= <input id="st" name="st" value="01:10:00 08-08-2007" />
<br />End Time= <input id="lt" name="lt" value="02:00:00 08-08-2007" />
<br /><a href="javascript:setvars();">Calculate Difference</a>
<br />Difference in Minutes= <input id="th" name="th" value="" />
</form>
<script>
function setvars()
{
var minutes = 1000 * 60;
var hours = minutes * 60;
var d1 = document.pirep.st.value;
var d2 = document.pirep.lt.value;
var e = Date.parse(d1);
var e1 = Date.parse(d2);
var y = e/minutes;
var y1 = e1/minutes;
var final = y1-y;
//document.pirep.st.value = e;
//document.pirep.lt.value = e1;
document.pirep.th.value = final;
}
</script>