<!DOCTYPE html><html><head><meta charset="UTF-8"><title></title></head><body><div id="Date"></div></body><script>setInterval(function(){var date =newDate();var year = date.getFullYear();//获取当前年份var mon = date.getMonth()+1;//获取当前月份var day = date.getDate();//获取当前日var week = date.getDay();//获取当前星期几var h = date.getHours();//获取小时var m = date.getMinutes();//获取分钟var s = date.getSeconds();//获取秒var d = document.getElementById('Date');
d.innerHTML = year+"-"+mon+"-"+day+" "+h+":"+m+":"+s+":"+""+"星期"+week;},1000)</script></html>