toInstantOrNull

fun Datetime.toInstantOrNull(): Instant?

Parse this AT Protocol Datetime as a kotlinx.datetime.Instant, returning null on malformed input instead of throwing.

Prefer this when reading Datetime values that may have been constructed locally or sourced from an untrusted producer. For server-emitted records prefer toInstant, which surfaces malformed data as a programming error.