From ed711791b6f2cb4bf30e83998eff3e4dcb890c7c Mon Sep 17 00:00:00 2001 From: floppydiskette Date: Thu, 22 Aug 2024 22:23:36 +0100 Subject: YOLO --- public/js/liveClock.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'public/js') diff --git a/public/js/liveClock.js b/public/js/liveClock.js index 07c9eae..0e7b5db 100644 --- a/public/js/liveClock.js +++ b/public/js/liveClock.js @@ -1,10 +1,6 @@ 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); + span.textContent = d.toLocaleString('en-US', {hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false, timeZone: 'Europe/London' }) } setInterval(time, 1000); -- cgit v1.2.3-54-g00ecf