core / io.islandtime.ranges / secondsBetween

secondsBetween

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun secondsBetween(start: DateTime, endExclusive: DateTime): LongSeconds

Get the number of whole seconds between two date-times, assuming they have the same UTC offset. 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.

Exceptions

ArithmeticException - if the result overflows

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun <T1, T2> secondsBetween(start: TimePoint<T1>, endExclusive: TimePoint<T2>): LongSeconds

Get the number of whole seconds between two time points.

Exceptions

ArithmeticException - if the result overflows