AddToDateTime function
Syntax
AddToDateTime(datetime, years, months, days, hours, minutes, seconds)
Description
Use the AddToDateTime function to add the specified number of years, months, days, hours, seconds, and minutes to the datetime provided. You can subtract from datetimes by passing the function negative numbers.
Parameters
| Parameter | Description |
|---|---|
|
datetime |
The initial Datetime value. |
|
years |
An integer representing the number of years to add to datetime. |
|
months |
An integer representing the number of months to add to datetime. |
|
days |
An integer representing the number of days to add to datetime. |
|
hours |
An integer representing the number of hours to add to datetime. |
|
minutes |
An integer representing the number of minutes to add to datetime. |
|
seconds |
An integer representing the number of seconds to add to datetime. |
Returns
A Datetime value equal to the original date plus the number of years, months, days, hours, minutes, and seconds passed to the function.
Example
The following example postpones an interview scheduled in the INTRTime field by two days and two hours:
INTRTIME = AddToDateTime(INTRTIME, 0, 0, 2, 2, 0, 0);