JavaScript 时钟(代码):
<html>
<body οnlοad=aaa()>
<script type="text/javascript">
var nowtime ;
var year ;
var month ,date,hours,minutes,seconds,all;
function aaa()
{
nowtime = new Date();
year = nowtime.getYear();
month = nowtime.getMonth()+1;
date = nowtime.getDate();
hours = nowtime.getHours();
minutes = nowtime.getMinutes();
seconds = nowtime.getSeconds();
if (seconds <10)
{
seconds = "0"+seconds;
}
if (minutes <10)
{
minutes = "0"+minutes;
}
all = year + " "+month +" "+ date +" "+ hours +":"+minutes+":"+seconds;
time.innerHTML = all;
window.setTimeout("aaa();",100);
}
</script>
<div id="time" ></div>
</body>
</html>