JSFiddle - React, Tailwind, and code Playground

by Josh Krauth-Harding

HTML

<div id="time"></div>

JavaScript

(() => {
  function startTime() {
    let today = new Date().toLocaleString("en-US", {
      timeZone: "America/Detroit"
    });
    let time = today.split(", ")[1];
    document.getElementById("time").innerHTML = time;
    setTimeout(function() {
      startTime()
    }, 1000);
  }
  startTime();
})();