I'm not sure I follow the use case for Kotlin's `D...
# getting-started
t
I'm not sure I follow the use case for Kotlin's
Duration
it seems to be missing
.between
? So I need to use Java's, in which case I can't use Kotlin's because importing both doesn't work? What am I missing?
e
you can
import x as y
to get around the name conflict locally
t
oh, and call kotlin's version something else?
or java's, I suppose.
e
either or both, right
t
it doesn't look like Kotlin's Duration will convert to a java Duration.
?
oh, but there is a function to go the other way... ok.
d
@TwoClocks you might want to use kotlinx-datetime. You'll get all you need, including
operator fun Instant.minus(Instant): Duration
to do
thisTime - thatTime
.
t
@Didier Villevalois thanks! I was not aware of this library. It solves all of my problems.
🎉 1