mirror of
https://github.com/aaronleetw/Attendance.git
synced 2024-11-14 11:01:39 -08:00
20 lines
No EOL
634 B
JavaScript
Vendored
20 lines
No EOL
634 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();
|
|
})(); |