I need to calculate the count of days between two given dates with time. For example the dates between '06/01/2019 09:00' and '06/02/2019 22:00' should count as 2 days for me. I tried the below code, but I don't get the result I need.
Any ideas on how to calculate the result?
$to = $_GET['end_date'];
$dteStart = new DateTime($from);
$dteEnd = new DateTime($to);
$diff = $dteStart->diff($dteEnd);
print $diff->format("%H:%I");