Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/12/2008, 13:46
jetzona
 
Fecha de Ingreso: marzo-2006
Mensajes: 202
Antigüedad: 18 años, 1 mes
Puntos: 2
Respuesta: convertir de texto a horas.

<?php
$thrs_p1 = "16";
$tmin_p1 = "47";
$thrs_p2 = "4";
$tmin_p2 = "29";
$hora1 = mktime($thrs_p1,$tmin_p1,0);
$hora2 = mktime($thrs_p2,$tmin_p2,0);
$hora_final = date("G:i",$hora1 + $hora2);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<p>
<input name="textfield" type="text" value="<?php echo $hora1 ?>">
</p>
<p>
<input name="textfield2" type="text" id="textfield2" value="<?php echo $hora2 ?>">
</p>
<p> <input name="txt1" type="text" id="txt1" value="<?php echo $hora_final ?>">
</p>
</body>
</html>


no funca me da cmo resultado 18:47...que estoy haciendo mal....????

Última edición por jetzona; 16/12/2008 a las 13:47 Razón: sorry...