Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript live time

var span = document.getElementById('span');

function time() {
  var d = new Date();
  var s = d.getSeconds();
  var m = d.getMinutes();
  var h = d.getHours();
  span.textContent = 
    ("0" + h)+ ":" + ("0" + m).substr(-2) + ":" + ("0" + s);
}

setInterval(time, 1000);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #live #time
ADD COMMENT
Topic
Name
4+4 =