I am currently using DateTime::diff() to return the days, hours, minutes, and seconds between two dates.
The problem is when the differences is more than 30 days, instead of returning 33 days it returns 1 month and 3 days.
Is there a way to tell it to return days and not month accordingly.
Some code:
$date1 = new DateTime(date('Y-m-d H:i:s', time()));
$date2 = new DateTime($row['start']);
$interval = $date1->diff($date2);
$days = $newInfo[$key]['days'] = $interval->format("%d");
$hours = $newInfo[$key]['hours'] = $interval->format("%h");
$minutes = $newInfo[$key]['minutes'] = $interval->format("%i");
$seconds = $newInfo[$key]['seconds'] = $interval->format("%s");