Xojo.Core.Date.Subtract
From Xojo Documentation
Method
Xojo.Core.Date.Operator_Subtract(interval As Xojo.Core.DateInterval) As Xojo.Core.Date
Supported for all project types and targets.
Supported for all project types and targets.
You can subtract a Date and a DateInterval to get a new Date.
Method
Xojo.Core.Date.Operator_Subtract(dateValue As Xojo.Core.Date) As Xojo.Core.DateInterval
Supported for all project types and targets.
Supported for all project types and targets.
You can subtract a Date from a Date and get a DateInterval.
Sample Code
Get the date two months before today:
Var twoMonths As New Xojo.Core.DateInterval
twoMonths.Months = 2 // 2 month interval
// Get date two months before today
Var past As Xojo.Core.Date = Xojo.Core.Date.Now - twoMonths
twoMonths.Months = 2 // 2 month interval
// Get date two months before today
Var past As Xojo.Core.Date = Xojo.Core.Date.Now - twoMonths
Calculate the interval until January 1, 2030: