From 9793d322d5d8c2611e6f989f13a1e31d2b66c2aa Mon Sep 17 00:00:00 2001 From: RajatGupta2002 <87117036+RajatGupta2002@users.noreply.github.com> Date: Sat, 23 Oct 2021 15:07:49 +0530 Subject: [PATCH] Updated Script.js corrected the time and date --- Clock/Script.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Clock/Script.js b/Clock/Script.js index 1df64e7..ce9868e 100644 --- a/Clock/Script.js +++ b/Clock/Script.js @@ -22,16 +22,28 @@ const dayArray = [ "Saturday", "Sunday", ]; -const updateTime = () => { - const date = new Date(); - const minute = date.getMinutes(); - const time = date.getHours() % 12; - const seconds = date.getSeconds(); - const day = date.getDay(); - timeEl.textContent = `${time}:${minute}`; +var updateTime = () => { + var date = new Date(); + var minute = date.getMinutes()+10; + + var time = date.getHours()%12; + + var seconds = date.getSeconds()+26; + if(seconds>=60) + { + minute=minute+1; + seconds=seconds%60; +} + if(minute>=60) + { + time=time+1; + minute=minute%60; + } + var day = date.getDay(); + timeEl.textContent = `${time}:${minute}:${seconds}`; day_date.textContent = `${ dayArray[day - 1] - },${date.getDate()} | ${date.getMonth()} | ${date.getFullYear()} `; + },${date.getDate()} | ${date.getMonth()+1} | ${date.getFullYear()} `; hour.style.transform = `translate(50%, -50%) rotate(${scale( time + minute * 0.01, 0,