JSFiddle - React, Tailwind, and code Playground
HTML
<span class="foo"></span>
JavaScript
function timeClock() {
setTimeout(timeClock, 1000);
now = new Date();
console.log(now);
f_date = now.getDate();
f_date +=" "+now.getMonth();
f_date +=" "+now.getFullYear();
f_date +=" / "+now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
$('.foo').html('Date: '+f_date);
return f_date;
}
$(function(){
$('.foo').html(timeClock());
});