Voici une fonctio qui marche bien pour faure la difference entre deux heures
/fonction addition heure difheure(debut , fin )
function difheure($heuredeb,$heurefin)
{
$hd=explode(":",$heuredeb);
$hf=explode(":",$heurefin);
$hd[0]=(int)($hd[0]);$hd[1]=(int)($hd[1]);$hd[2]=(int)($hd[2]);
$hf[0]=(int)($hf[0]);$hf[1]=(int)($hf[1]);$hf[2]=(int)($hf[2]);
if($hf[2]<$hd[2]){$hf[1]=$hf[1]-1;$hf[2]=$hf[2]+60;}
if($hf[1]<$hd[1]){$hf[0]=$hf[0]-1;$hf[1]=$hf[1]+60;}
if($hf[0]<$hd[0]){$hf[0]=$hf[0]+24;}
return (($hf[0]-$hd[0]).":".($hf[1]-$hd[1]).":".($hf[2]-$hd[2]));
}
// fin de fonction
?>