how to get now time in js code example
Example 1: get current time in javascript
var d = new Date();
var n = d.toLocaleTimeString();
document.getElementById("timer").innnerHTML = n;
Example 2: get current time in js
<script>
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
</script>