core / io.islandtime.ranges / yearsBetween

yearsBetween

(iosArm64, iosX64, jvm, macosX64) fun yearsBetween(start: Date, endExclusive: Date): IntYears

Get the number of whole years between two dates.

(iosArm64, iosX64, jvm, macosX64) fun yearsBetween(start: DateTime, endExclusive: DateTime): IntYears

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

(iosArm64, iosX64, jvm, macosX64) fun yearsBetween(start: OffsetDateTime, endExclusive: OffsetDateTime): IntYears

Get the number of whole years between two date-times, ignoring the offsets.

(iosArm64, iosX64, jvm, macosX64) fun yearsBetween(start: ZonedDateTime, endExclusive: ZonedDateTime): IntYears

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