You are here: irt.org | FAQ | JavaScript | Date | Q626 [ previous next ]
Try:
<SCRIPT LANGUAGE="JavaScript"><!-- var t1 = '08:30', t2 = '08:45'; var m = (t1.substring(0,t1.indexOf(':'))-0) * 60 + (t1.substring(t1.indexOf(':')+1,t1.length)-0) + (t2.substring(0,t2.indexOf(':'))-0) * 60 + (t2.substring(t2.indexOf(':')+1,t2.length)-0); var h = Math.floor(m / 60); document.write(h + ':' + (m - (h * 60))); //--></SCRIPT>