Ver Mensaje Individual
  #8 (permalink)  
Antiguo 25/07/2012, 10:45
Zota
 
Fecha de Ingreso: julio-2012
Mensajes: 51
Antigüedad: 11 años, 9 meses
Puntos: 0
Respuesta: Guardar fecha actual en campo

Hola a todos ya tengo el codigo de un reloj con fecha en java script, ahora lo que necesito es capturar en el momento de hacer el submit o insertar datos a la base la fecha y hora que esta mmostrando, alguien me puede ayudar???

reloj java


Código PHP:
<html>
<head>
<title>el reloJ</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
    var Hoy = new Date("<?php echo date("d M Y G:i:s");?>");
function Reloj(){ 
    Hora = Hoy.getHours() 
    Minutos = Hoy.getMinutes() 
    Segundos = Hoy.getSeconds() 
    if (Hora<=9) Hora = "0" + Hora 
    if (Minutos<=9) Minutos = "0" + Minutos 
    if (Segundos<=9) Segundos = "0" + Segundos 
    var Dia = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"); 
    var Mes = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); 
    var Anio = Hoy.getFullYear(); 
    var Fecha = Dia[Hoy.getDay()] + ", " + Hoy.getDate() + " de " + Mes[Hoy.getMonth()] + " de " + Anio + ", a las "; 
    var Inicio, Script, Final, Total 
    Inicio = "<font size=3 color=black>" 
    Script = Fecha + Hora + ":" + Minutos + ":" + Segundos 
    Final = "</font>" 
    Total = Inicio + Script + Final 
    document.getElementById('Fecha_Reloj').innerHTML = Total 
    Hoy.setSeconds(Hoy.getSeconds() +1)
    setTimeout("Reloj()",1000) 

</script>
</head>
<body onload="Reloj()">
<div id="Fecha_Reloj"></div>
</body>
</html>