I can't figure why when I change the format of a date then I parse it into a localDate to set it in my object, i keep getting this error :
java.time.format.DateTimeParseException: Text '07/02/2020' could not be parsed at index 0
Here's my code :
LocalDate dateMission = mission.getDateMission(); //getting my date in yyyy/MM/dd
LocalDate newDateMission = dateMission.plusDays(1); //Adding + 1 day in yyyy/MM/dd
String test = DateTimeFormatter.ofPattern("dd-MM-yyyy", Locale.FRANCE).format(newDateMission); // changing format yyyy/MM/dd to dd/MM/yyyy
LocalDate finnalDateMission = LocalDate.parse(test); //parsing string to LocalDate
mission.setDateMission(finnalDateMission); // setting new date in LocalDate in format dd/MM/yyyy