<html>
<head>
<script>
var date = new Date();
//年
var year = date.getFullYear();
//月
var month = date.getMonth()+1;
//日
var day = date.getDate();
//周
var week = date.getDay();
alert(week);
if(week==0){
str = "日";
}else if(week==1){
str = "一";
}else if(week==2){
str = "二";
}else if(week==3){
str = "三";
}else if(week==4){
str = "四";
}else if(week==5){
str = "五"
}else{
str = "六";
}
//时
var hours =date.getHours();
//分
var minutes = date.getMinutes();
//秒
var seconds = date.getSeconds();
var clock = "当前时间为:"+year+"年"+month+"月"+day+"日 周"+str+" "+hours+"时"+minutes+"分"+seconds+"秒";
document.write(clock);
</script>
</head>
<body>
</body>
</html>
Caballarii
相关分类