<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定时器</title>
<script type="text/javascript">
function clock(){
var time=new Date();
var y=time.getFullYear();
var mya1=new Array(time.getFullYear()+"年");
var m=time.getMonth();
var mya2=new Array(time.getMonth()+"月");
var d=time.getDate();
var mya3=new Array(time.getDate()+"日");
var h=time.getHours();
if(h<10){h="0"+h};
var mya4=new Array(time.getHours()+"时");
var min=time.getMinutes();
if(min<10){min="0"+min};
var mya5=new Array(time.getMinutes()+"分");
var s=time.getSeconds();
if(s<10){s="0"+s};
var mya6=new Array(time.getSeconds()+"秒");
var weekdly=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var week=time.getDay();
var mya7=new Array("今天是:"+time.getDay());
var may8=mya1.concat(mya2,mya3,mya4,mya5,mya6,mya7)
document.write(mya8)
}
setInterval(clock,1000)
</script>
</head>
<body>
<form>
<input type="text" id="clock" size="50" />
</form>
</body>
</html>
兰兰蓝
相关分类