toKotlinDuration

Platform and version requirements: JVM (1.3), JRE8 (1.3)
@ExperimentalTime fun Duration.toKotlinDuration(): Duration

Converts java.time.Duration value to kotlin.time.Duration value.

Durations less than 104 days are converted exactly, and durations greater than that can lose some precision due to rounding.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/java.time.-duration/to-kotlin-duration.html