> Realtime Clock
Site hosted by Angelfire.com: Build your free website today!

Real Time Clock

<==== this is the Real time clock



this Real time clock show the takes the time from the computer, so it will show the time that the computer is set on, if the time on the computer is right so will be the time in the Real time clock!!!





Here's the script: This first part will go in the HEAD portion of your page
<script language="JavaScript">
function showRealTime()
{
var TheTimeNow = new Date();
var hours = TheTimeNow.getHours();
var minutes = TheTimeNow.getMinutes();
var seconds = TheTimeNow.getSeconds();
var timeString = "" + ((hours > 12) ? hours - 12 : hours);
timeString += ((minutes < 10) ? ":0" : ":") + minutes;
timeString += ((seconds < 10) ? ":0" : ":") + seconds;
timeString += (hours >= 12) ? " p.m " : " a.m ";
document.form1.>line1.value = timeString;
timerID = >setTimeout("showRealTime()", 1000);
}
</script>




The next step is the form:


This is the form field that the clock is on, you can put it where ever you like on your page.
<form name="form1">
<input type="text" name="line1" size=14>
</form>


you have to write this in as your body onLoad

<:BODY onload="ShowRealTime()">