Attendance/static/time.js
2021-12-12 18:38:10 +08:00

22 lines
No EOL
674 B
JavaScript
Vendored

(function () {
function checkTime(i) {
return (i < 10) ? "0" + i : i;
}
function startTime() {
var today = new Date(),
y = today.getFullYear(),
mm = checkTime(today.getMonth() + 1),
d = checkTime(today.getDate()),
h = checkTime(today.getHours()),
m = checkTime(today.getMinutes()),
s = checkTime(today.getSeconds());
document.getElementById('showTime').innerHTML = y + "/" + mm + "/" + d + " " + h + ":" + m + ":" + s;
t = setTimeout(function () {
startTime()
}, 500);
}
startTime();
})();
$(window).resize();
$(window).scroll();