monthsUntil

fun Instant.monthsUntil(other: Instant, timeZone: TimeZone): Int(source)

Returns the number of whole months 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.


Returns the number of whole months 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