Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • OffsetDateTime will do and conceptually matches a date-time with an offset better. Commented Apr 8, 2018 at 17:04
  • Hey @OleV.V. thanks for the suggestion. Sadly no: OffsetDateTime.parse() will throw an exception for several valid ISO 8601 strings, e.g. "2017-09-13T10:36:40+01" or "2017-09-13" Commented Apr 9, 2018 at 17:01
  • I only meant to say that OffsetDateTime handles the examples that you handle with ZonedDateTime. I believe that it doesn’t handle any of the examples that ZonedDateTime doesn’t. In that sense it’s no improvement (but also no worse). Sorry, I wasn’t perfectly clear. Commented Apr 9, 2018 at 17:55