javascript get the current time code example
Example 1: javascript get current time
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
Example 2: get current time in javascript
var d = new Date();
var n = d.toLocaleTimeString();
document.getElementById("timer").innnerHTML = n;