1 hrs, 9 min, 4 seg, 0 days, 0 mon,0 years
---------------------------------
tiempo que utilizo.
fecha: 2013-03-13
Hora insertada: 14:49:21 //hh:mm:ss
Hora del pc: 14:40:26
-------------------------------
aqui el codigo:
Código:
if($rs=odbc_fetch_array($rsl)){
$fch=$rs['Hora'];
$fh=$rs['Fecha'];
$fc=substr($fch,0,8);
$hf=substr($fh,0,10);
$th=$hf." ".$fc;
//$date1 = $t;
$date1 = date("Y-m-d G:i:s\n");
$th;
$diff = abs(strtotime($th) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60));
$minuts = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60);
$seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minuts*60));
printf("%d hrs, %d min, %d seg, %d days, %d mon,%d years\n", $hours, $minuts, $seconds, $days, $months, $years);
}
porque me da 1 hora transcurrida se supone que es 0 horas?
1 hrs, 9 min, 4 seg, 0 days, 0 mon,0 years
de antemano gracias y saludos.