Foros del Web » Programando para Internet » PHP »

error

Estas en el tema de error en el foro de PHP en Foros del Web. tengo este error en mi pagina Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\apachefriends\xampp\htdocs\wtofercamion.php on line ...
  #1 (permalink)  
Antiguo 22/12/2010, 06:59
 
Fecha de Ingreso: diciembre-2010
Mensajes: 32
Antigüedad: 13 años, 4 meses
Puntos: 0
error

tengo este error en mi pagina
Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\apachefriends\xampp\htdocs\wtofercamion.php on line 38

alguien me lo puede comentar
un saludo.
  #2 (permalink)  
Antiguo 22/12/2010, 07:01
 
Fecha de Ingreso: febrero-2010
Mensajes: 818
Antigüedad: 14 años, 2 meses
Puntos: 55
Respuesta: error

error con la funcion date, si muestras el codigo seria mas facil saber el error
  #3 (permalink)  
Antiguo 22/12/2010, 07:05
 
Fecha de Ingreso: diciembre-2010
Mensajes: 32
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: error

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

$fecha=$_POST[dispo_camion];
list ($dia,$mes,$ano)=split("/",$fecha);
$nueva=mktime(0,0,0,$mes,$dia,$ano)+($_POST[dia_camion]*24*60*60);
$nuevafecha=date("d/m/Y",$nueva);
$diamesano=explode("/",$nuevafecha);
$nuevafecha=$diamesano[0]."/".$diamesano[1]."/".$diamesano[2];
$nuevafecha2=$diamesano[2]."/".$diamesano[1]."/".$diamesano[0];

$origen1 = $_POST["origen"];
$destino1 = $_POST["destino"];

for($i=0 ; $i<4 ; $i++) {
$Origen[$i] = $origen1[$i];
}
for ($j=0 ; $j<4 ; $j++) {
$Destino[$j] = $destino1[$j];


este es el codigo y comienza en la linea 9 y termina en la 50
un saludo. y gracias
  #4 (permalink)  
Antiguo 22/12/2010, 07:25
 
Fecha de Ingreso: diciembre-2010
Mensajes: 32
Antigüedad: 13 años, 4 meses
Puntos: 1
Respuesta: error

Probá cambiar:

Código PHP:
Ver original
  1. $nueva=mktime(0,0,0,$mes,$dia,$ano)+($_POST[dia_camion]*24*60*60);

por

Código PHP:
Ver original
  1. $nueva=strtotime($ano."-".$mes."-".$dia)+($_POST[dia_camion]*24*60*60);
  #5 (permalink)  
Antiguo 22/12/2010, 08:26
 
Fecha de Ingreso: diciembre-2010
Mensajes: 32
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: error

Gracias
lo he cambiado y funciona perfectamente
muchas gracias
un saludo.

Etiquetas: Ninguno
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 21:03.