I have 2 datetime , and I wanna to calculate difference in minutes :
$date_reservation=strtotime($_POST['date_reservation']);;
$dt = new DateTime();
$date_annulation = strtotime($dt->format('Y-m-d H:i:s'));
$attente = (round(abs($date_annulation - $date_reservation)/60)%60);
It only take the difference between minute without hours .
I've tried this function ( from php documentation )
$interval = $date_annulation->diff($date_reservation);
$years = $interval->format('%y');
$months = $interval->format('%m');
$days = $interval->format('%d');
But it dosn't work (error 500)