How do I set a live clock, i.e. one that updates automatically in hours minutes and seconds, how do I set it to start at the time I tell it, rather than one retrieived from the users computer? I want to input a timestamp as it’s start point, if possible… then I want it to count up from my specified time live. (looping to update each second).
This is the clock that uses the user’s computer time:
<!– Begin
function clock() {
if (!document.layers && !document.all) return;
// right here I’d like to put in my own date //
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = “AM”;
if (hours > 11) amOrPm = “PM”;
if (hours > 12) hours = hours – 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = “0” + minutes;
if (seconds <= 9) seconds = “0” + seconds;
dispTime = hours + “:” + minutes + “:” + seconds + ” ” + amOrPm;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout(“clock()”, 1000);
}
// End –>
</script>
<p><center><br>
<font face=”arial, helvetica” size”-2″>Free JavaScripts provided<br>
by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
</center><p>