From 33c49199c7e85b0f07503855d2f71cd64c0bfc10 Mon Sep 17 00:00:00 2001 From: floppydiskette Date: Thu, 8 Aug 2024 02:00:44 +0100 Subject: Initial redesign commit --- public/js/liveClock.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 public/js/liveClock.js (limited to 'public/js/liveClock.js') 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); -- cgit v1.2.3-54-g00ecf