I tried this:
val x = java.time.Instant.parse("2022-12-12T09:51:09.681+0100")
But it throws an exception.
Exception in thread "main" java.time.format.DateTimeParseException: Text '2022-12-12T09:51:09.681+0100' could not be parsed at index 23
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948)
at java.base/java.time.Instant.parse(Instant.java:395)
at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated$ScratchFileRunnerGenerated.<init>(tmp.kt:8)
at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated.main(tmp.kt:13)
What is wrong with the timestamp?
If I compare it to https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC I can not see an error.
This does not work either:
java.time.OffsetDateTime.parse("2022-12-12T09:51:09.681+0100")