Foros del Web » Programando para Internet » Javascript »

Fecha mayor a hoy

Estas en el tema de Fecha mayor a hoy en el foro de Javascript en Foros del Web. Hola. Necesito su util ayuda. Tengo un campo en donde dejo la fecha y la hora, pero esta debe ser mayor en a lo menos ...
  #1 (permalink)  
Antiguo 11/04/2006, 10:41
 
Fecha de Ingreso: julio-2002
Ubicación: Rancagua - Chile
Mensajes: 494
Antigüedad: 21 años, 9 meses
Puntos: 0
Fecha mayor a hoy

Hola.
Necesito su util ayuda.
Tengo un campo en donde dejo la fecha y la hora, pero esta debe ser mayor en a lo menos 15 minutos que la actual. Es decir, si son las 12:15 de hoy, la fecha puesta debe ser igual o superior a 2006-04-11 12:30

Espero me puedan ayudar.
Gracias.

Salu2 !!!
__________________
AK.T.I.V.E.tm Live, Never DIE
  #2 (permalink)  
Antiguo 11/04/2006, 12:18
Avatar de Mephisto  
Fecha de Ingreso: enero-2006
Ubicación: Mexico DF
Mensajes: 184
Antigüedad: 18 años, 4 meses
Puntos: 3
este codigo te muestra la hora del sistema, espero te sirva...

Código:
<HTML>
<HEAD>
<TITLE>Día y Hora</TITLE>
<SCRIPT LANGUAGE="JavaScript">


  var timerID = null
  var timerRunning = false
  function MakeArray(size) 
  {
  this.length = size;
  for(var i = 1; i <= size; i++)
  {
  this[i] = "";
  }
  return this;
  }
  function stopclock (){
  if(timerRunning)
  clearTimeout(timerID);
  timerRunning = false
  }
  function showtime () {
  var now = new Date();
  year = new String(now.getYear())
  yearLen = year.length
  year = year.split("")
  year = year[yearLen - 2] + year[yearLen - 1]
  var month = now.getMonth() + 1;
  var date = now.getDate();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  var day = now.getDay();
  Day = new MakeArray(7);
  Day[0]="Domingo";
  Day[1]="Lunes";
  Day[2]="Martes";
  Day[3]="Miércoles";  // Conjunto de nombres de días de la semana.
  Day[4]="Jueves";
  Day[5]="Viernes";
  Day[6]="Sábado";
  var timeValue = "";
  timeValue += (Day[day]) + "   ";
  timeValue += ((month < 10) ? " 0" : " ") + month + "-";
  timeValue += date + "-" + year + "    ";                  // Creación del formato de la hora (y día).
  timeValue += ((hours <= 12) ? hours : hours - 12);
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  timeValue += (hours < 12) ? " AM" : " PM";
  document.jsfrm.face.value = timeValue;
  timerID = setTimeout("showtime()",1000);     // Llamada a la función mostrar hora cada segundo.
  timerRunning = true
  }
  function startclock () {
  stopclock();
  showtime()
  }
</SCRIPT>
</HEAD>
<!-- Llamada a la función 'startclock' al cargar el documento. -->

<body text="#153584" BGCOLOR="#ffffff" link="#153584" vlink="#B5B5B5" onLoad="startclock();">

<CENTER><H2>Día y Hora</H2></CENTER><BR>
<CENTER><FORM NAME='jsfrm'>
<INPUT TYPE=text NAME='face' size=33 value=''>
</FORM></CENTER><BR>

</BODY>
</HTML>
__________________
Saludos...

Todos somos sabios, solo que en diferentes disciplinas...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:11.