java.time.format.DateTimeParseException: Text '2020-11-09 04:59:59.203' could not be parsed: Unable to obtain ZonedDateTime from TemporalAccessor: {},ISO resolved to 2020-11-09 04:59:59.203 of type java.time.format.Parsed
LocalDate localDate= add90Days("2020-11-09 04:59:59.203",2);
Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
Employee e = new Employee();
e.setEndDate(date);
private static LocalDate add90Days(String rentalEndDate,int days) {
ZonedDateTime odt90DaysLater=null;
try {
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
ZonedDateTime odt = ZonedDateTime.parse(rentalEndDate, inputFormatter);
odt90DaysLater = odt.plusDays(days);
} catch (Exception e) {
e.printStackTrace();
}
return odt90DaysLater.toLocalDate();
}