DateTime formatDateOnly(String date) { var inputFormat = DateFormat("dd-MM-yyyy"); var inputDate = inputFormat.parse(date); return inputDate; }