<!--CLOCK I--> <!-- This part can go in the HEAD of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Copyright 2001, Sandeep Gangadharan --> <!-- For more free scripts go to http://sivamdesign.com/scripts/ --> <!-- function sivamtime() { now=new Date(); hour=now.getHours(); min=now.getMinutes(); sec=now.getSeconds(); if (min<=9) { min="0"+min; } if (sec<=9) { sec="0"+sec; } if (hour>12) { hour=hour-12; add="pm"; } else { hour=hour; add="am"; } if (hour==12) { add="pm"; } if (hour==00) { hour="12"; } document.hours.clock.value = (hour<=9) ? "0"+hour : hour; document.minutes.clock.value = min; document.seconds.clock.value = sec; document.ampm.clock.value= add; setTimeout("sivamtime()", 1000); } // --> </script> <!-- This goes into the BODY of the file wherever you want to have the time placed --> <!-- Note the script in the BODY tag --> <body onLoad="sivamtime()"> <table border="0" align="center" cellpadding="0" cellspacing="0" width="118"> <tr> <td> <form name="hours"> <p><input type="text" size="2" name="clock"></p> </form> </td> <td> <form name="minutes"> <p><input type="text" size="2" name="clock"></p> </form> </td> <td> <form name="seconds"> <p><input type="text" size="2" name="clock"></p> </form> </td> <td> <form name="ampm"> <p><input type="text" size="2" name="clock"></p> </form> </td> </tr> </table> </body> <!-- ==================================================================================== --> <!-- For 24 hour time add this script --> <!--CLOCK--> <!-- This part can go in the head of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Created by Sandeep Gangadharan --> <!-- For more free scripts go to http://web1.mtnl.net.in/~sivam/jspage.html --> <!-- function sivamtime() { now=new Date(); hour=now.getHours(); min=now.getMinutes(); sec=now.getSeconds(); if (min<=9) { min="0"+min; } if (sec<=9) { sec="0"+sec; } if (hour<10) { hour="0"+hour; } document.hours.clock.value = hour; document.minutes.clock.value = min; document.seconds.clock.value = sec; setTimeout("sivamtime()", 1000); } // --> </script> <!-- This goes into the body of the file wherever you want to have the time placed --> <!-- Note the script in the "body" tag --> <body onLoad="sivamtime()"> <table border="0" align="center" cellpadding="0" cellspacing="0" width="80"> <tr> <td> <form name="hours"> <p><input type="text" size="2" name="clock"></p> </form> </td> <td> <form name="minutes"> <p><input type="text" size="2" name="clock"></p> </form> </td> <td> <form name="seconds"> <p><input type="text" size="2" name="clock"></p> </form> </td> </tr> </table>