java.time.Duration vs kotlin.time.Duration? Is the...
# android
t
java.time.Duration vs kotlin.time.Duration? Is there a good reason to prefer one over the other? I need to work with both those and Instants (which I don't think Kotlin has it's "own" version of yet, and java.time.Instant is still the goto there).
m
There's a Kotlinx library for DateTime that has Instant and most of the classes in the java.time library. #kotlinx-datetime The Kotlin Duration is a inline value class, so it might use less space. I haven't used the java version, so I cannot give much feedback with comparing them. Going all Kotlin makes it easier to convert to multiplatform.
362 Views