var timerID = 0; function actualizaHora() { if(timerID) { clearTimeout(timerID); } var fecha = new Date(); var minutos; if(fecha.getMinutes()<10) minutos = "0"+fecha.getMinutes(); else minutos = fecha.getMinutes(); var obj = document.getElementById("hora"); var new_txt = document.createTextNode(" " + fecha.getHours() + ":" + minutos); obj.replaceChild(new_txt, obj.childNodes[0]); timerID = setTimeout("actualizaHora()", 1000); } function Stop() { if(timerID) { clearTimeout(timerID); timerID = 0; } } function displayFecha() { var today = new Date(); var day = today.getDate(); var month = today.getMonth(); var year = today.getYear(); var dia = today.getDay(); if (year < 1000) { year += 1900; } var fecha = (day + "/" + month + "/" + year); return fecha; }