wah.moe/public/js/liveClock.js

11 lines
311 B
JavaScript
Raw Normal View History

2024-08-08 01:00:44 +00:00
function time() {
var span = document.getElementById("clock");
var d = new Date();
var s = d.getSeconds();
var m = d.getMinutes();
var h = d.getHours();
span.textContent =
("0" + h).substr(-2) + ":" + ("0" + m).substr(-2) + ":" + ("0" + s).substr(-2);
}
setInterval(time, 1000);