lille og smart?-)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Udregning af tidsdifference</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
function calSecs(t){
s=t.split(":");
return (parseInt(s[0]*3600)+parseInt(s[1]*60)+parseInt(s[2]));
}
function calDiff(int){
return (underTi(parseInt(int/3600))+":"+underTi(parseInt(int%3600/60))+":"+underTi(parseInt(int%3600%60)));
}
function underTi(obj){
return ((obj<10)?"0"+obj:obj);
}
function timeDiff(t1,t2){
alert(calDiff(calSecs(t2)-calSecs(t1)));
return true;
}
</script>
</head>
<body>
<form name="frm0" method="post" action="">
<input type="text" name="t1" value="03:54:19">
<input type="text" name="t2" value="03:58:22">
<input type="button" name="Button1" value="Button" onclick="timeDiff(this.form.t1.value,this.form.t2.value);">
</form>
<form name="frm1" method="post" action="">
<input type="text" name="t11" value="10:00:00">
<input type="text" name="t22" value="10:30:00">
<input type="button" name="Button2" value="Button" onclick="timeDiff(this.form.t11.value,this.form.t22.value);">
</form>
</body>
</html>