0
Show the clock of the website in console
I want get clock of a website server and show it in console, how can i do this?
2 ответов
+ 1
You can copy simply this piece of code:
function printTime() {
    var d = new Date();
    var hours = d.getHours();
    var mins = d.getMinutes();
    var secs = d.getSeconds(); 
     document.getElementById("time").innerHTML = hours+":"+mins+":"+secs;
     document.getElementById("id_of_element").innerHTML=hours+":"+mins;
}
setInterval(printTime, 1);
I hope I helped you 😄
Have a happy coding 🙂



