Java - Java LocalDateTime Text could not be parsed at index 0 exception
Trying to convert a date which is in String format to Java LocalDateTime.
private DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"); private String caseStartDate = dateFormat.format(LocalDateTime.now()); LocalDateTime localdatetime = LocalDateTime.parse(caseStartDate);
But ends up having this exception:
java.time.format.DateTimeParseException: Text '01/03/2020 15:13' could not be parsed at index 0
Doesnt this format support for conversion?
There are 1 suggested solutions here and each one has been listed below with a detailed description. The following topics have been covered briefly such as Java, Localdatetime. These have been categorized in sections for a clear and precise explanation.