<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
setInterval(function(){ //该函数为函数执行的速度
var padDate = function(va) {
va = va < 10 ? '0' + va : va;
return va
}
var date = new Date();
var year = date.getFullYear();
var month = padDate(date.getMonth() + 1);
var day = padDate(date.getDate());
var hours = padDate(date.getHours());
var minutes = padDate(date.getMinutes());
var seconds = padDate(date.getSeconds());
var week="日一二三四五六".charAt(new Date().getDay());
var shijian="当前时间为"+year+"年"+month+"月"+day+"日"+hours+"时"+minutes+"分"+seconds+"秒"+"星期"+week;
var div=document.getElementById(time);
time.innerHTML=shijian;
},1000)//1000毫秒一次
</script>
<style type="text/css">
#time{
width: 550px;
height: 80px;
background-color: skyblue;
font-size: 20px;
color: white;
text-align: center;
letter-spacing: 2px;
border-radius: 80px;
line-height: 80px;
}
</style>
</head>
<body>
<div id="time">
</div>
</body>
</html>