JSFiddle - React, Tailwind, and code Playground

by cherif_b

HTML

<div id="date">here</div>

JavaScript

function heure()
{
    auj = new Date();
    h = auj.getHours();
    m = auj.getMinutes();
    s = auj.getSeconds();
        if(h<10)
        { h = '0'+h; }
            if(m<10)
        { m = '0'+m; }
            if(s<10)
        { s = '0'+s; }
    date = ''+h+'h'+m+'m'+s+'';
    var di=$('#date');
    di.html(date);
}
//heure();
window.setInterval(heure(),1000);