diff options
Diffstat (limited to 'js/clock.js')
| -rw-r--r-- | js/clock.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/clock.js b/js/clock.js new file mode 100644 index 0000000..ac4f5af --- /dev/null +++ b/js/clock.js @@ -0,0 +1,14 @@ +// prepare footer clock +let clock = document.getElementById("clock"); +let timeFormat = new Intl.DateTimeFormat("en-US", { + dateStyle: "short", + timeStyle: "long", + timeZone: "America/New_York", +}); + +// start clock +clock.innerText = timeFormat.format(Date.now()); + +setInterval(() => { + clock.innerText = timeFormat.format(Date.now()); +}, 1000);
\ No newline at end of file |
