JSFiddle - React, Tailwind, and code Playground
HTML
<body onload=display_ct();>
<span id='ct' ></span>
</body>
JavaScript
function display_c(){
var refresh=1000; // Refresh rate in milli seconds
mytime=setTimeout('display_ct()',refresh)
}
function display_ct() {
var x = new Date()
var x1=x.getMonth() + 1+ "/" + x.getDate() + "/" + x.getYear();
x1 = x1 + " - " + x.getHours( )+ ":" + x.getMinutes() + ":" + x.getSeconds();
var hour=x.getHours();
var minute=x.getMinutes();
var second=x.getSeconds();
if(minute <10 ) {minute='0' + minute; }
if(second<10){second='0' + second;}
var x3 = hour+':'+minute+':'+second
document.getElementById('ct').innerHTML = x3;
display_c();
}