标签:获得 doc interval return function eth 系统 gets nload
<script>
function get_time() {
var date = new Date();
var year = "", month = "", day = "", week = "", hour = "", minute = "", second = "";
year = date.getFullYear();
month = add_zero(date.getMonth() + 1);
day = add_zero(date.getDate());
hour = add_zero(date.getHours());
minute = add_zero(date.getMinutes());
second = add_zero(date.getSeconds());
document.getElementById("showSysDatetime").innerHTML = " " + year + "-"
+ month + "-" + day + " " + hour + ":" + minute + ":" + second;
}
function add_zero(temp) {
if (temp < 10)
return "0" + temp;
else
return temp;
}
setInterval("get_time()", 1000);
window.onload = get_time;
</script>
标签:获得 doc interval return function eth 系统 gets nload
原文地址:http://www.cnblogs.com/zhangZhangWorkHard/p/7565148.html