I have a function which calculate the difference between two timestamps,
public static function getDuration($from, $to) {
$duration = $to - $from;
return $duration;
}
but this is not working as required. example, if i pass,
$difference = getDuration(strtotime('19-07-2012 23:00:00'), strtotime('20-07-2012 4:45:00'));
echo $difference/3600;
it returns 5.75 instead of 5.45, when converted to hours.