From 7c53c58f80adc5e5066587035938a32a57bc3c1e Mon Sep 17 00:00:00 2001 From: Kainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com> Date: Sat, 5 Mar 2022 14:02:30 -0800 Subject: [PATCH] Update script.js --- scr/script.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scr/script.js b/scr/script.js index b84c2b5..9722fb5 100644 --- a/scr/script.js +++ b/scr/script.js @@ -1,12 +1,12 @@ function updateClock() { - const date = new Date(); - const hours = date.getHours(); - const minutes = date.getMinutes(); - const ampm = hours >= 12 ? 'pm' : 'am'; + let date = new Date(); + let hours = date.getHours(); + let minutes = date.getMinutes(); + let ampm = hours >= 12 ? 'pm' : 'am'; hours = hours % 12; hours = hours ? hours : 12; minutes = minutes < 10 ? '0'+minutes : minutes; - const time = hours + ':' + minutes + ' ' + ampm; + let time = hours + ':' + minutes + ' ' + ampm; document.getElementById('time').innerHTML = time; setTimeout(updateClock, 1000); }