how to create local time in javascript | SoloLearn: Learn to code for FREE!

+1

how to create local time in javascript

showlocal time

3/28/2020 5:09:25 PM

Rocky Francisco

5 Answers

New Answer

+2

var a = new Date(); alert(a);

+2

+1

alert with running time

+1

function printTime() { var d = new Date(); var hours = d.getHours(); var mins = d.getMinutes(); var secs = d.getSeconds(); document.body.innerHTML = hours+":"+mins+":"+secs} setInterval(printTime, 0.1000);

+1

thanks its work