diff options
author | floppydiskette <git@diskfloppy.me> | 2024-08-08 02:00:44 +0100 |
---|---|---|
committer | floppydiskette <git@diskfloppy.me> | 2024-08-08 02:00:44 +0100 |
commit | e3f67fec07884b70e2a988ac0bb8cf6c9a750582 (patch) | |
tree | 280593edcd53a8789b4330e8aac708f1a34e3659 /public/js/liveClock.js | |
parent | 9900446d9590024c34f55a45055776a396fb694e (diff) |
Initial redesign commit
Diffstat (limited to 'public/js/liveClock.js')
-rw-r--r-- | public/js/liveClock.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/public/js/liveClock.js b/public/js/liveClock.js new file mode 100644 index 0000000..07c9eae --- /dev/null +++ b/public/js/liveClock.js @@ -0,0 +1,10 @@ +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); |