//core/io.islandtime.ranges/toDuration
toDuration¶
common
fun DateTimeInterval.toDuration(): Duration
Converts this interval to the Duration between the start and end date-time, which are assumed to be in the same time zone. In general, it's more appropriate to calculate duration using Instant or ZonedDateTime as any daylight savings rules won't be taken into account when working with DateTime directly.
Throws¶
kotlin.UnsupportedOperationException | if the interval isn't bounded |
common
fun TimePointInterval<*>.toDuration(): Duration
Converts this interval into a Duration of the same length.
Throws¶
kotlin.UnsupportedOperationException | if the interval isn't bounded |