Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/03/2006, 00:43
cyborg
 
Fecha de Ingreso: febrero-2004
Ubicación: España. Madrid
Mensajes: 454
Antigüedad: 20 años, 2 meses
Puntos: 0
bueno.. te paso el código de un reloj que pusieron hace tiempo:

fichero hora.html

<html>
<script language="JavaScript" src="horalocal.php"></script>

<script language="JavaScript" >
<!--
h = H.getHours()
m = H.getMinutes()
s = H.getSeconds()
d = H.getDate()
mm = H.getMonth()
y = H.getFullYear()
function laHora(){
H2 = new Date(y,d,mm,h,m,s+1)
h = H2.getHours(); h2 = h
m = H2.getMinutes(); m2 = m
s = H2.getSeconds();s2 = s
if(s<10){s2 = "0" + s}
if(m<10){m2 = "0" + m}
if(h<10){h2 = "0" + h}
document.getElementById('reloj').firstChild.nodeVa lue = h2 + ":" + m2 + ":" + s2
}
onload = function(){laHora();setInterval('laHora()',1000)
}

</script>

<div id="reloj">-</div>
</html>

fichero horalocal.php

<?
$H = date("y,m,d,H,i,s");
echo "H = new Date($H)";
?>