I've got problem with passing date and time (12 hour format) in my LocalDateTime object. Here's what I've done:
LocalDateTime MyDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm a");
MyDate.parse(date_frome_string, formatter)
When I'm trying to past text like:
2020-09-04 09:15 PM
I've got following error:
Exception in thread "main" java.time.format.DateTimeParseException: Text '2020-09-04 09:15 PM' could not be parsed: Conflict found: Field AmPmOfDay 0 differs from AmPmOfDay 1 derived from 09:15
When I'm passing:
2020-09-04 09:15 AM
It's all ok.