<!--12/24 HOUR FORMAT CLOCK--> <!-- This part can go in the HEAD of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Copyright 2002, Sandeep Gangadharan --> <!-- For more free scripts go to http://sivamdesign.com/scripts/ --> <!-- function formatTime() { now = new Date(); hour = now.getHours(); min = now.getMinutes(); sec = now.getSeconds(); if (document.clock.sivamtime[0].checked) { if (min <= 9) { min = "0" + min; } if (sec <= 9) { sec = "0" + sec; } if (hour > 12) { hour = hour - 12; add = " p.m."; } else { hour = hour; add = " a.m."; } if (hour == 12) { add = " p.m."; } if (hour == 00) { hour = "12"; } document.clock.sivam.value = ((hour<=9) ? "0" + hour : hour) + ":" + min + ":" + sec + add; } if (document.clock.sivamtime[1].checked) { if (min <= 9) { min = "0" + min; } if (sec <= 9) { sec = "0" + sec; } if (hour < 10) { hour = "0" + hour; } document.clock.sivam.value = hour + ':' + min + ':' + sec; } setTimeout("formatTime()", 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="formatTime();"> <form name="clock"> <table border="4" align="center" cellspacing="0" cellpadding="2" width="130"> <tr> <td align="center"> <input type="text" name="sivam" size="12" /> </td> </tr> <tr> <td align="center"> <label for="1"><input type="radio" id="1" name="sivamtime" checked /><font face="verdana, arial, helvetica, ms sans serif" size="1">12 Hour Format</font></label><br /> <label for="2"><input type="radio" id="2" name="sivamtime" /><font face="verdana, arial, helvetica, ms sans serif" size="1">24 Hour Format</font></label> </td> </tr> </table> </form> </body> </html>