I find my self in a situation where I need to display many clocks in this format: HH:MM:SS, which isn’t a problem, but I need loads of these, all starting at a pre-defined times and still simultaneously counting up as a clock would. e.g. 05:52:13 | 03:14:32 | 07:41:11 … and so on. Here’s my basic clock script, but I have no idea where to go from here. I’m still a javascript noob
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('txt').innerHTML =
h + ":" + m + ":" + s;
var t = setTimeout(startTime, 500);
}
function checkTime(i) {
if (i < 10) {i = "0" + i};
return i;
}
Any help would be much appreciated