Log 2761
11/02/2024 2024-02-11 7:55$calendarField = “10/11/2024 18:00 – 10/11/2024 22:00″;
// Extract the start and end dates from the calendar field
$startEndDates = explode(” – “, $calendarField);
$startDate = strtotime($startEndDates[0]);
$endDate = strtotime($startEndDates[1]);
// Calculate the difference in hours between the start and end dates
$timeDiffHours = round(($endDate – $startDate) / (60 * 60), 2);
return $timeDiffHours;