aboutsummaryrefslogtreecommitdiff
path: root/public/js/liveClock.js
diff options
context:
space:
mode:
authorfloppydiskette <git@diskfloppy.me>2024-08-08 02:00:44 +0100
committerfloppydiskette <git@diskfloppy.me>2024-08-08 02:00:44 +0100
commit33c49199c7e85b0f07503855d2f71cd64c0bfc10 (patch)
tree280593edcd53a8789b4330e8aac708f1a34e3659 /public/js/liveClock.js
parent031aa417b8918d9067f062774f5228587e89ef36 (diff)
Initial redesign commit
Diffstat (limited to 'public/js/liveClock.js')
-rw-r--r--public/js/liveClock.js10
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);