From 56af79a784775826dc7fa4a6fee9bfae679e5ad0 Mon Sep 17 00:00:00 2001 From: Bijaya Limbu Date: Wed, 22 Jan 2025 13:40:08 +0545 Subject: [PATCH] Update time.js --- time.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/time.js b/time.js index d31b90d..0d35b21 100644 --- a/time.js +++ b/time.js @@ -3,13 +3,18 @@ function updateTime() { timeZone: 'Asia/Kathmandu', hour12: false, hour: '2-digit', - minute: '2-digit', - month: 'short', - day: 'numeric', }; const now = new Date().toLocaleString('en-US', options); + const currentHour = parseInt(now.substring(0, 2)); + document.getElementById('time-display').innerText = now; + + if (currentHour >= 18) { + document.body.style.backgroundColor = 'black'; + } else { + document.body.style.backgroundColor = 'white'; // or your preferred default color + } } // Update time every second