I've got an error when I try to convert this string to date:
String s = "Mon, 11-12-2021 - 12:00";
LocalDateTime localDateTime = LocalDateTime.parse(s, DateTimeFormatter.ofPattern("EEE, MM-dd-yyyy - HH:mm"));
I got this:
Exception in thread "main" java.time.format.DateTimeParseException: Text 'Mon, 11-12-2021 - 12:00' could not be parsed at index 0
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
at java.time.LocalDateTime.parse(LocalDateTime.java:492)
at Main.main(Main.java:11)
Is it possible in Java to convert this string or it should be changed in some way?