Tema: la hora...
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/11/2007, 12:58
Avatar de DragonX
DragonX
Colaborador
 
Fecha de Ingreso: mayo-2002
Ubicación: Funkyland
Mensajes: 8.433
Antigüedad: 22 años, 10 meses
Puntos: 177
Re: la hora...

Debés ubicar este script en cualquier parte de la página (dentro de las etiquetas BODY) donde quieras que aparezca la fecha y la hora:

Código HTML:
<script LANGUAGE="JavaScript">
<!-- COMIENZO
Stamp = new Date();
year = Stamp.getYear();
if (year < 2000) year = 1900 + year;
document.write('<font size="2" face="Arial"><B>Fecha: ' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+ year + '</B></font><BR>');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write('<font size="2" face="Arial"><B>Hora: ' + Hours + ":" + Mins + Time + '</B></font>');
// FIN -->
</script> 
__________________
Desarrollos dosLotos
Calendario Maya, Meditación, Osho