I have a date in the following format: 1/1/2020 3:4:7 AM I am trying to format it using DateTimeFormatter.
I have the following code with a formatter to parse it, but it doesn't work.
LocalDateTime date = LocalDateTime.parse("1/1/2020 3:4:7 AM", DateTimeFormatter.ofPattern("MM/dd/yyyy hh:mm:ss a"));
I get the following exception:
java.time.format.DateTimeParseException: Text '1/1/2020 3:4:7 AM' could not be parsed at index 0
Can anyone help me?