Here's my function

```
<?php    
//Find time difference
    function timeDifference($timeEnd, $timeStart){
      $tResult = strtotime($timeEnd) - strtotime($timeStart);
      return date("G:i", $tResult-3600);
    }
?>

```

And an example

```
<?php
   echo timeDifference(12:00:00,08:30:00);
?>

```

The results on my localhost was fine but online on my server it's showing 21:30 when it's supposed to be 3:30. What could do that?

**UPDATE**

Here my solution for php 5.2

```
<?php
//Find time difference
function timeDifference($timeEnd, $timeStart){
  $tResult = round(abs(strtotime($timeEnd) - strtotime($timeStart)));
  return gmdate("G:i", $tResult);
}
?>

```

Thanks for the help guys