You can use the DateAdd function to add or subtract a specified time interval from a date. For example, you can calculate a date 30 days from today or a time 45 minutes before now.
To add days to DateValue, you can use DateInterval.Day, DateInterval.DayOfYear, or DateInterval.Weekday. These are treated as equivalent because DayOfYear and Weekday are not meaningful time intervals.
The DateAdd function never returns an invalid date. If necessary, the day part of the resulting date is adjusted downward to the last day of the resulting month in the resulting year. The following example adds one month to January 31:
Dim NextMonth As Date = DateAdd(DateInterval.Month, 1, #1/31/1995#)
In this example, DateAdd returns #2/28/1995#, not #2/31/1995#. If DateValue is #1/31/1996#, it returns #2/29/1996# because 1996 is a leap year.
Since every Date value is supported by a DateTime structure, its methods give you additional options in adding time intervals. For example, you can add a fractional number of days, rounded to the nearest millisecond, to a Date variable as follows:
Dim NextTime As Date = Now ' Current date and time.
NextTime = NextTime.AddDays(3.4) ' Increment by 3 2/5 days.