I am trying to use Java 8's new date pattern instead of Joda, and I have the following problem:
Both
ZonedDateTime.parse("02/05/16 11:51.12.083 +04:30", DateTimeFormatter.ofPattern("dd/MM/yy HH:mm.ss.SSS Z"))
and
LocalDateTime.parse("02/05/16 11:51.12.083 +04:30", DateTimeFormatter.ofPattern("dd/MM/yy HH:mm.ss.SSS Z"))
throw 'java.time.format.DateTimeParseException' exception. Until
org.joda.time.DateTime.parse("02/05/16 11:51.12.083 +04:30", DateTimeFormat.forPattern("dd/MM/yy HH:mm.ss.SSS Z"))
works great.
Reason for exclusion:
java.time.format.DateTimeParseException: text '02 / 05/16 11: 51.12.083 +04: 30 'could not be parsed by index 22
Am I doing something wrong?
source share