To transition to the stable Duration API introduce...
# stdlib
h
To transition to the stable Duration API introduced in v1.6, how can I convert a
kotlin.time.Duration
to a
java.time.temporal.TemporalAmont
? E.g. to do
Instant.now() + 5.seconds
. With the JDK Duration its easy, because it implements
TemporalAmont
.
i
You can convert it to java.time.Duration using the extension method https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/to-java-duration.html
h
Thanks @ilya.gorbunov