DateAdd
The DateAdd function returns a new Date that adds the specified number
of units to the value of Date.
Prototype
DateAdd(Date; Value; Unit)
Arguments
Date Date By value
A valid Date. The argument can be a literal, the result of an expression or a variable (Studio only) that
evaluates a Date.
Value Number By value
A valid number to be added to Date. Number can be negative; argument can be a literal, the result of an
expression or a variable (Studio only) that evaluates a number.
Unit String By value
A valid String, containing the selected Unit. Argument can be a literal, the result of an expression or
a variable (Studio only) that evaluates a String. Valid Units are
| Unit | Description |
|---|---|
| Ms | Milliseconds |
| S | Seconds |
| M | Minutes |
| H | Hours |
| D | Days |
| Mm | Months |
| Y | Years |
Returns
Date
The new Date whose value is the sum of Date and Number (UTC format).
Exception
Undefined
Undefined is returned if:
- Date is Undefined or is not a Date
- Value is Undefined or is not a Number
- Format is Undefined, is not a String, or does not contain a valid Unit
Example
DateAdd( Date(052020) ; 1; 'd')
This will return 05/02/2020 0:0:0 UTC.