I am trying to calculate the time difference between two timestamps. After looking around here for a while I found this solution:
$start = strtotime(10:00:00);
$end = strtotime(10:30:00);
$diff = ($end - $start);
echo 'Time 1: '.date('H:i:s', $start).'<br>';
echo 'Time 2: '.date('H:i:s', $end).'<br>';
echo 'Diff: '.date('H:i:s', $diff);
It seems to work, the time 1 and time 2 show the correct times, but the difference shows 01:30:00, not 00:30:00 as it should. I have tried setting the correct timezone but it didnt help. Any ideas?