<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<span id="span"></span>
<script type="text/javascript">
function fun(){
var date=new Date();
document.getElementById("span").innerHTML=(1900+date.getYear())+"年"+(date.getMonth()+1)+"月"+date.getDay()+"日"+date.getHours()+"时"+date.getMinutes()+"分"+date.getSeconds()+"秒"
}
setInterval(fun,1000)
</script>
</body>
</html>
输出图片如下: