Xojo.Core.DateInterval.Years

From Xojo Documentation

Property (As Integer )
aXojo.Core.DateInterval.Years = newIntegerValue
or
IntegerValue = aXojo.Core.DateInterval.Years

Supported for all project types and targets.

The number of years in the interval.

Sample Code

Dim d1 As New Xojo.CoreDate(2017, 5, 1, Xojo.CoreTimeZone.Current)
Dim d2 As New Xojo.CoreDate(2030, 1, 1, Xojo.CoreTimeZone.Current)
Dim interval As Xojo.CoreDateInterval
interval = d2 - d1
// interval.Years = 12