<!-- JavaScript facilitado por JANU1535 en www.JanuWeb.Com --> 

function calcula() 
{ 

 hoy = new Date() 
 avui=hoy.getDay();
 mes=hoy.getMonth();

 hasta = new Date("December 31, 3000 00:00") // Cambiar aquí el valor de la fecha y hora elegida. 
 dia_avui= new Date(mes)
 //alert(dia_avui);
 DD = (hasta - hoy) / 86400000 // Dies
 hh = (DD - Math.floor(DD)) * 24 // Hores
 mm = (hh - Math.floor(hh)) * 60 // Minuts
 ss = (mm - Math.floor(mm)) * 60 // Segons
 //Codi Original:
 //document.getElementById('hora').innerHTML =  Math.floor(DD) + " Días, " + Math.floor(hh) + " Horas, " + Math.floor(mm) + " Minutos y " + Math.floor(ss) + " Segundos. "
 document.getElementById('hora').innerHTML = "Sólo quedan " + Math.floor(hh) + " horas, " + Math.floor(mm) + " minutos y " + Math.floor(ss) + " segundos para terminar el día." 
 if (hasta < hoy) 
 { 
  document.getElementById('hora').innerHTML = "Ha llegado el día d" 
  cleartimeout(tictac) 
 } 
 else tictac = setTimeout("calcula()",1000) 
} 
