JSFiddle - React, Tailwind, and code Playground
HTML
<div id="timestamp">0</div>
JavaScript
var timestamp=0;
function time100(){
time100.cb=function(t,r){
//alert("На сервере"+new Date(t)+" На компью "+new Date(r))
timestamp=t;
};
}
time100();
i=document.createElement("script")
i.setAttribute("src", "//time100.ru/api.php?type=cb&t="+new Date().getTime())
j=document.getElementsByTagName("head").item(0)
j.appendChild(i)
window.onload = function() {
lll=new Date(timestamp);
// начать повторы с интервалом 1 сек
var timerId = setInterval(function() {
lll.setSeconds(lll.getSeconds() + 1);
document.getElementById('timestamp').innerHTML=lll;
}, 1000);
}