JavaScript Clock by JohnMali



How To Use It


If you want to use this clock on your page you must insert this code in betwixt the head tags on your page.
<script language="JavaScript"> //You may use this clock in your own //page as long as you do not change //any of it. //(c)John Woehler, 1997 function doTime () { var hour=0 var isPM=false var seconds=0 var minutes=0 var clock now=new Date () //clock=new String () hour=now.getHours () if (hour>12) { hour-=12 isPM=true } clock=""+hour clock+=":" minutes=now.getMinutes () if (minutes<10) clock+="0" clock+=minutes seconds=now.getSeconds () clock+="." if (seconds<10) clock+="0" clock+=""+seconds if (isPM) clock+=" PM" else clock+=" AM" document.ClockForm.Clock.value=clock setTimeout ("doTime ()", 500) } //End Clock code. </script>
After you have done this, you must this code at some location on your page where you wish the clock to be.
<script language="JavaScript"> document.write ("<form name=\"ClockForm\">"); document.write ("<input type=\"text\" name=\"Clock\" size=10>"); document.write ("</form>"); doTime (); </script>

About


This script was written using edit.com.
Questions or comment: johnmali@aol.com
or visit my web page.
This script is (C)John Woehler, 1997