This JavaScript allows you to display the time of your computer:
<html>
<script language=”Javascript”>
setInterval(”settime()”, 1000);function settime () {
var curtime = new Date();
var curhour = curtime.getHours();
var curmin = curtime.getMinutes();
var cursec = curtime.getSeconds();
var time = “”;if(curhour == 0) curhour = 12;
time = (curhour > 12 ? curhour - 12 : curhour) + “:” +
(curmin < 10 ? “0″ : “”) + curmin + “:” +
(cursec < 10 ? “0″ : “”) + cursec + ” ” +
(curhour > 12 ? “PM” : “AM”);document.form1.clock.value = time;
}
</script><body>
<form name=”form1″>
<input type=”text” name=”clock” >
</form></body>
</html>
Be First To Comment
Related Post
Leave Your Comments Below