DateInterval
From Xojo Documentation
Class (inherits from Object)
New in 2019r2
A DateInterval is used to modify a date object. You specify how much you want to offset the date by and then add (or subtract) the interval to the date to get a new date object.
Properties | |||||||
|
Constructors | |
|
Examples
This example adds 5 days to the current date:
Var d As DateTime = DateTime.Now
Var interval As New DateInterval(0, 0, 5)
d = d + interval
MessageBox(d.ToString)
Var interval As New DateInterval(0, 0, 5)
d = d + interval
MessageBox(d.ToString)
This example adds 1 year, 3 months and 4 days to the current date:
Var d As DateTime = DateTime.Now
Var interval As New DateInterval(1, 3, 4)
d = d + interval
MessageBox(d.ToString)
Var interval As New DateInterval(1, 3, 4)
d = d + interval
MessageBox(d.ToString)
This example adds 8 hours to the current date:
Var d As DateTime = DateTime.Now
Var interval As New DateInterval(0, 0, 0, 8)
d = d + interval
MessageBox(d.ToString)
Var interval As New DateInterval(0, 0, 0, 8)
d = d + interval
MessageBox(d.ToString)
See Also
DateTime class