Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Forked from raelmax/simple_timer.js
Created August 16, 2013 01:46
Show Gist options
  • Save rochacbruno/6246555 to your computer and use it in GitHub Desktop.
Save rochacbruno/6246555 to your computer and use it in GitHub Desktop.
var alvo = document.getElementById("id_origem"),
data = new Date();
var addTime = function(){
data.setSeconds(data.getSeconds() + 1);
alvo.value = data.getHours() + ":" + data.getMinutes() + ":" + data.getSeconds();
};
setInterval(addTime, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment