计时器为什么没办法加入星期????
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定时器</title>
<script type="text/javascript">
var attime;
function clock(){
var time=new Date();
/* var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var x=weekday[time.getDay()];
document.write(x);*/
attime=time.getFullYear()+"年"+(time.getMonth()+1)+"月"+time.getDate()+"日 "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
document.getElementById("clock").value = attime;
}
attime=setInterval(clock,1000);
</script>
</head>
<body>
<form>
<input type="text" id="clock" size="50" />
</form>
</body>
</html>
不能输出x,x放在attime=time.getFullYear()+......+x;公式就没法运行了,请帮忙看看是什么问题?