Hi,
ich habe folgende Zeit als String 2017-01-27T11:10:38+0100, welchen ich ihn ein LocalDateTime Objekt bringen will.
Laut Javadoc, sollte das mit
LocalDateTime.parse("2017-01-27T11:10:38+0100", DateTimeFormatter.ISO_DATE_TIME)
, da DateTimeFormatter.ISO_DATE_TIME laut doc "The ISO-like date-time formatter that formats or parses a date-time with the offset and zone if available, such as ‘2011-12-03T10:15:30’, ‘2011-12-03T10:15:30+01:00’ or ‘2011-12-03T10:15:30+01:00[Europe/Paris]’.
Lass ich den Code aber bei mir laufen, fliegt eine RuntimeException
Exception in thread "main" java.time.format.DateTimeParseException: Text '2017-01-27T11:10:38+0100' could not be parsed at index 19
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1947)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1849)
at java.time.LocalDateTime.parse(LocalDateTime.java:492)
at test.TestClass.main(TestClass.java:14)
was übersehe ich ?