core / io.islandtime.ranges / monthsBetween

monthsBetween

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun monthsBetween(start: Date, endExclusive: Date): IntMonths

Get the number of whole months between two dates.

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

Get the number of whole months between two date-times, assuming they're in the same time zone.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun monthsBetween(start: OffsetDateTime, endExclusive: OffsetDateTime): IntMonths

Get the number of whole months between two date-times, adjusting the offset of endExclusive if necessary to match the starting date-time.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) fun monthsBetween(start: ZonedDateTime, endExclusive: ZonedDateTime): IntMonths

Get the number of whole months between two zoned date-times, adjusting the time zone of endExclusive if necessary to match the starting date-time.