toArray()['date_start']); $dateEnd = new DateTimeImmutable($request->toArray()['date_end']); return new JsonResponse(["interval"=>($dateStart->diff($dateEnd)->format("%a"))] , Response::HTTP_OK); } }