$fdate = $request->Fdate; $tdate = $request->Tdate; $datetime1 = new DateTime($fdate); $datetime2 = new DateTime($tdate); $interval = $datetime1->diff($datetime2); $days = $interval->format('%a');//now do whatever you like with $days