yearsUntil

actual fun LocalDate.yearsUntil(other: LocalDate): Int(source)
fun Instant.yearsUntil(other: Instant, timeZone: TimeZone): Int(source)

Returns the number of whole years between two instants in the specified timeZone.

If the result does not fit in Int, returns Int.MAX_VALUE for a positive result or Int.MIN_VALUE for a negative result.

See also

Throws

if this or other instant is too large to fit in LocalDateTime.


expect fun LocalDate.yearsUntil(other: LocalDate): Int(source)

Returns the number of whole years between two dates.

If the result does not fit in Int, returns Int.MAX_VALUE for a positive result or Int.MIN_VALUE for a negative result.

See also

actual fun LocalDate.yearsUntil(other: LocalDate): Int(source)
actual fun LocalDate.yearsUntil(other: LocalDate): Int(source)