Failed to parse single digit hour and lowercase am-pm of day into Java 8 LocalTime
When I try to run the following code: LocalTime test = LocalTime.parse("8:00am", DateTimeFormatter.ofPattern("hh:mma")); I get this: Exception in thread "main" java.time.format.DateTimeParseException: Text '8:00am' could not be parsed at index 0 Any idea why this might be happening? The AM/PM tokens have* to be uppercase: LocalTime test = LocalTime.parse("8:00AM", DateTimeFormatter.ofPattern("hh:mma")); Patterns definitions for hours: Symbol Meaning Presentation Examples ------ ------------ ------------ -------- a am-pm-of-day text PM h clock-hour-of-am-pm (1-12) number 12 K hour-of-am-pm (0