curioustechizen
07/18/2025, 1:25 PMkotlin.time.Instant
and kotlin.time.Clock
were introduced in Kotlin 2.1.20
Then, kotlinx.serialization added support for these 2 types in v1.9.0, but that requires Kotlin 2.2
What are my options if I want to stay on Kotlin 2.1.20 and want to serialize kotlin.time.Instant types? Is the compat
artifact useful for this situation?jw
07/18/2025, 1:28 PMjw
07/18/2025, 1:30 PMtoEpochMilliseconds
to fromEpochMilliseconds
and you're done.curioustechizen
07/18/2025, 1:32 PMhfhbd
07/18/2025, 1:37 PMNikky
07/19/2025, 5:39 PMobject InstantSerializer : FormattedInstantSerializer(
"ISO", DateTimeComponents.Formats.ISO_DATE_TIME_OFFSET
)
or such iirc