HTML Javascript Clock (Date and Time)
1. Go to web site Click HERE
2. Copy the code and paste HTML Javascript
<script type="text/javascript"> tday=new Array ("Sunday","Monday","Tuesday", "Wednesday","Thursday","Frida y","Saturday"); tmonth=new Array ("January","February","March" ,"April","May","June","July", "August","September","October ","November","December"); function GetClock(){ var d=new Date(); var nday=d.getDay (),nmonth=d.getMonth (),ndate=d.getDate (),nyear=d.getYear(); if(nyear<1000) nyear+=1900; var nhour=d.getHours (),nmin=d.getMinutes (),nsec=d.getSeconds(),ap; if(nhour==0){ap=" AM";nhour=12;} else if(nhour<12){ap=" AM";} else if(nhour==12){ap=" PM";} else if(nhour>12){ap=" PM";nhour-=12;} if(nmin<=9) nmin="0"+nmin; if(nsec<=9) nsec="0"+nsec; document.getElementById ('clockbox').innerHTML=""+tda y[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour +":"+nmin+":"+nsec+ap+""; } window.onload=function(){ GetClock(); setInterval(GetClock,1000); } </script> <div id="clockbox"></div>
That's it!
<script type="text/javascript">
tday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
function GetClock(){
var d=new Date();
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getYear();
if(nyear<1000) nyear+=1900;
var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap;
if(nhour==0){ap=" AM";nhour=12;}
else if(nhour<12){ap=" AM";}
else if(nhour==12){ap=" PM";}
else if(nhour>12){ap=" PM";nhour-=12;}
if(nmin<=9) nmin="0"+nmin;
if(nsec<=9) nsec="0"+nsec;
document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+"";
}
window.onload=function(){
GetClock();
setInterval(GetClock,1000);
}
</script>
<div id="clockbox"></div>