LocalDateTime.parse("2017-02-02 08:59:12", DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss"));
It prints error:
java.time.format.DateTimeParseException: Text '2017-02-02 08:59:12' could not be parsed: Unable to obtain LocalDateTime from TemporalAccessor: {MinuteOfHour=59, NanoOfSecond=0, SecondOfMinute=12, MicroOfSecond=0, MilliOfSecond=0, HourOfAmPm=8},ISO resolved to 2017-02-02 of type java.time.format.Parsed
Accoeding message looks like all values parsed correct, but anyway I see error.
How to make it working?
LocalDate
orLocalDateTime
? You indicate hours etc in your formatter – FazioLocalDateTime
. The code you have in your question works – FazioHourOfAmPm=8
. It does not say hour of day… – Cladoceran