DHTML Clock
Instructions:
1: Copy and paste the following script in the HEAD section of your page:
Select all...
<script language="javascript"> var ns4=(document.layers)?true:false; var ie4=(document.all && !document.getElementById)?true:false; var now=new Date(); now.hrs='00'; now.min='00'; now.sec='00'; var dclk; function setclock(){ now=new Date(); now.hrs=now.getHours(); now.min=now.getMinutes(); now.sec=now.getSeconds(); now.hrs=((now.hrs>12)? now.hrs-12 : now.hrs)+""; now.hrs=((now.hrs<10)? "0" : "")+now.hrs; now.min=((now.min<10)? "0" : "")+now.min; now.sec=((now.sec<10)? "0" : "")+now.sec; if(ns4){ dclk.document.open(); dclk.document.write('
'+now.hrs+':'+now.min+':'+now.sec+'
'); dclk.document.close(); }else dclk.innerHTML=now.hrs+':'+now.min+':'+now.sec; } window.onload=function(){ setInterval('setclock()',300); dclk=(ns4)?document.layers['dclk']:(ie4)?document.all['dclk']:document.getElementById('dclk'); } window.onresize=function(){ if(ns4)setTimeout('history.go(0)',400); } </script>
2: Copy and paste the following HTML in the BODY section of your page:
Select all...
Note: If the clock does not look right on your page, simply adjust the table height & width.