I am trying to subtract time
<?php
$start_time = date('09:00:00');
$close_time = date('18:00:00');
$query = "SELECT * FROM staff_attend WHERE staff_name= '$staffname'";
$result_data = mysqli_query($conn, $query) or die('Unable to execute' . mysqli_error($conn));
while ($row_data = mysqli_fetch_assoc($result_data)) {
$rep_time = strtotime($row_data['rep_time']);
$leave_time=strtotime($row_data['leav_time']);
$start=(strtotime($start_time));
$leave=(strtotime($close_time));
$morning_shift=(($rep_time-$start)/3600);
$evening_shift=(($leave-$leave_time)/3600);
echo "<tr>";
echo "<td class='tg-h2xt80'>".date('d/m/Y',strtotime($row_data['comp_date']));
echo "<td class='tg-h2xt120'>".$row_data['rep_time'];
echo "<td class='tg-h2xt80'>". $row_data['leav_time']."</td>";
echo "<td class='tg-h2xt120'>".$morning_shift;
echo "<td class='tg-h2xt120'>".$evening_shift;
if a person is late by 1 hr it shows 1 , but
if a person is late bu 30 minutes it shows 0.5 and not 0.30
or
if late by 1.05 it shows 1.08333
how do i correct this ?