JSFiddle - React, Tailwind, and code Playground

HTML

<div id="clock"></div>
<script type="text/javascript">
function updateclock(){
    ourDate = new Date();
    document.getElementById("clock").innerHTML = ourDate.toLocaleString();
}

function startclock() {
    updateclock();
    setInterval(updateclock, 1000); 
}

startclock();
</script>