Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/02/2016, 12:36
thezzin
 
Fecha de Ingreso: septiembre-2008
Mensajes: 350
Antigüedad: 18 años, 1 mes
Puntos: 31
Respuesta: contador acumulativo de horas date()

algo asi

Código PHP:
<?php 
function sumTime(){
$i = 0;
foreach (
func_get_args() as $time){
sscanf($time, '%d:%d:%d', $hour, $min, $sec);
$i += $hour * 60 + $min + $sec;
}
if (
$h = floor($i / 60)){
$i %= 60;
}
return 
sprintf('%02d:%02d:%02d', $h, $i, $s);//= echo date("H:i:s");
}
//Como usar
$tm = '20:00:00';
$ex = '10:00:00';
echo 
sumTime($tm, $ex);//=30:00:00
?>
__________________
╬-----╬
║☺₧☻║
╬-----╬