IncDay etc.
Sub IncYear($date As DateTime, $years As Integer) As DateTime
Sub IncMonth($date As DateTime, $months As Integer) As DateTime
Sub IncDay($date As DateTime, $days As Integer) As DateTime
Sub IncHour($date As DateTime, $hours As Integer) As DateTime
Sub IncMinute($date As DateTime, $minutes As Integer) As DateTime
Sub IncSecond($date As DateTime, $seconds As Integer) As DateTime
Returns a date that is shifted by the specified number of years, months, days, hours, minutes, or seconds.
The value can be negative to calculate an earlier date.
Parameters
- $date ... Date expression.
- Value ... Integer value. Positive or negative value to increase or decrease $date.
Example:
Dim $d
$d = Now
$d = IncDay($d, 2) ' add 2 days
$d = IncDay($d, -60) ' minus 60 days