/*获取当前时间*/ var now = new Date(); var hh = now.getHours(); var mm = now.getMinutes(); var ss = now.getSeconds(); var date1 = document.getElementById("now1"); var date2 = document.getElementById("now2"); function getDateWeek(obj) {if (obj < 10) return "0" + obj; else return obj;} date1.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss); date2.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss+2);
日期:2020.7.29