Tema: Fecha + Hora
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/10/2005, 01:06
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años, 1 mes
Puntos: 1284
Hola leoj90:

¿Qué te parece redefinir el método toString() del objeto Date...?

Código:
Date.prototype.toString = function()	{
  Meses = ["enero","febrero","marzo","abril","mayo","junio",
"julio","agosto","septiembre","octubre","noviembre","diciembre"];
  return this.getDate() + "/" + Meses[this.getMonth()] + "/" + this.getFullYear() + " | " + this.getHours() + ":" + this.getMinutes();
}
... y luego simplemente mostrar un objeto...

alert(new Date());

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo