mirror of
https://github.com/aaronleetw/Attendance.git
synced 2024-11-15 03:21:38 -08:00
22 lines
No EOL
674 B
JavaScript
22 lines
No EOL
674 B
JavaScript
(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(); |