i want to calculate the hour difference between the startdatetime and enddatetime in HOURS.
The date is in format MM/DD/YYYY and TIME in HH:MM:SS format
Below is the code :
$strt_date = "03/24/2014";
$start_time = "23:14:57";
$end_date = "03/25/2014";
$end_time = "07:34:55";
$datetime1 = new DateTime($strt_date $start_time);
$datetime2 = new DateTime($end_date $end_time);
$diff = $datetime1->diff($datetime2);
$diff1 = $diff->format('%h');