With the following formatter I'm able to parse "2017-03-28T23:40:06.000+0100"
new DateTimeFormatterBuilder()
.append(ISO_LOCAL_DATE_TIME)
.appendPattern("X")
.toFormatter();
With another one it parses "2017-03-28T23:40:06.000+01:00"
new DateTimeFormatterBuilder()
.append(ISO_LOCAL_DATE_TIME)
.appendPattern("XX")
.toFormatter();
However, I'm unable to specify formatter that parses both. What pattern should I append?
Formatter should also be able to process timestamps without zone-offset, e.g. "2017-03-28T23:40:06.000Z"