How do I show the current time in the format HH:MM:SS?
You can use native function Date.toLocaleTimeString():
Date.toLocaleTimeString()
var d = new Date(); var n = d.toLocaleTimeString();
This will display e.g.:
"11:33:01"
MDN: Date toLocaleTimeString
var d = new Date(); var n = d.toLocaleTimeString(); alert("The time is: "+n);
1.4m articles
1.4m replys
5 comments
57.0k users