How to parse every valid ISO 8601 time stamp?

I tried this:

java.time.OffsetDateTime.parse("2022-12-12T09:51:09.681+0100")

But it fails: Kotlin Playground: Edit, Run, Share Kotlin Code Online

You miss a colon in the offset, should be:

"2022-12-12T09:51:09.681+01:00"
2 Likes