I am trying to parse a simple string [08/May/2020:09:14:05 +0000] to LocalDateTime using DateTimeFormatter and LocalDateTime but it seems that it does not work for some reasons. I have tried different changes to the format like DD, hh, X, x, or Z but it doesn't work.
Here is the code:
String log = "[08/May/2020:09:14:05 +0000]";
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("[d/MMM/yyyy:HH:mm:ss x]");
LocalDateTime odt = LocalDateTime.parse(log, fmt);
System.out.println(odt);
Any guess?