wah.moe/public/js/liveClock.js
floppydiskette 7d10ce0616 Merge me, Seymour! (#1)
Reviewed-on: https://git.frzn.dev///fwoppydwisk/diskfloppy.me/pulls/1
Co-authored-by: floppydiskette <git@diskfloppy.me>
Co-committed-by: floppydiskette <git@diskfloppy.me>
2024-08-08 14:25:01 +00:00

11 lines
311 B
JavaScript

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);