<script type="text/javascript">      
 function bodyLoad() {           
    var dateTime = new Date();           
    var hh = dateTime.getHours();           
    var mm = dateTime.getMinutes();           
    var ss = dateTime.getSeconds();           
    var yy = dateTime.getFullYear();           
    var MM = dateTime.getMonth() + 1;  //因为1月这个方法返回为0,所以加1          
    var dd = dateTime.getDate();           
    var week = dateTime.getDay();           
var days = ["", "", "", "", "", "", "", ] //document.getElementById("date").value = yy + "年" + MM + "月" + dd + "日 " + "星期" + days[week]; document.getElementById("time").innerHTML = yy + "-" + MM + "-" + dd + " " + hh + ":" + mm + ":" + ss; setTimeout(bodyLoad, 1000); } </script> <body onload="bodyLoad()"> <label id="time"></label> </body>

 

posted on 2015-12-17 09:49  Mr.He多多指教  阅读(128)  评论(0编辑  收藏  举报