Question: I need to find how much time is between to time values (their difference) which are over 24:00:00.

For example: how can I calculate the difference between `42:00:00` and `37:30:00`?

Using `strtotime`, `strptotime`, etc is useless since they cannot go over 23:59:59 ....

Answer: 
```
$a_split = explode(":", "42:00:00");
$b_split = explode(":", "37:30:00");

$a_stamp = mktime($a_split[0], $a_split[1], $a_split[2]);
$b_stamp = mktime($b_split[0], $b_split[1], $b_split[2]);

if($a_stamp > $b_stamp)
{
 $diff = $a_stamp - $b_stamp;
}else{
 $diff = $b_stamp - $a_stamp;
}

echo "difference in time (seconds): " . $diff;

```

then use date() to convert seconds to HH:MM:SS if you want.
I havent tested this, but this might do what you want:

```
function timediff($time1, $time2) {
  list($h,$m,$s) = explode(":",$time1);
  $t1 = $h * 3600 + $m * 60 + $s;
  list($h2,$m2,$s2) = explode(":",$time2);
  $seconds = ($h2 * 3600 + $m2 * 60 + $s2) - $t1;
  return sprintf("%02d:%02d:%02d",floor($seconds/3600),floor($seconds/60)%60,$seconds % 60); 
}

```