Returns a Date containing a date to which a specified time interval has been added.
Syntax:
MathLibObject.DateTimeAdd(Interval As String, Number As Long, dtDate As Date)
The DateTimeAdd Method (MathLib Object) syntax has these parts:
| Part |
Description |
| MathLibObject |
An object expression that evaluates to a MathLib object. |
| Interval |
(Required). A String value that determines the interval of time that you want to add as described in settings. |
| Number |
(Required). A Long Integer value that determines the number of intervals that you want to add. It can be positive (to get dates in the future) or negative (to get dates in the past). |
| dtDate |
(Required). A Date value representing the date to which the interval is added. |
The settings for Interval are:
| Setting |
Description |
| yyyy |
Year. |
| q |
Quarter. |
| m |
Month. |
| y |
Day of year. |
| d |
Day. |
| w |
Weekday. |
| ww |
Week. |
| h |
Hour. |
| n |
Minute. |
| s |
Second. |
Remarks:
You can use the DateTimeAdd function to add or subtract a specified time interval from a date.