The dateAdd() function adds a specified time interval to a given time and returns the result.
dateAdd(time, interval, unit)
Augment | Type | Description |
|---|---|---|
time | Datetime, timestamp, string | The orginal time |
interval | Integer | The value of time interval to add |
unit | string | The unit of the interval, which can be set as year, month, day, hour, minute, or second |
Return type: Datetime
UQLreturn dateAdd("1970-01-01 10:00:00", -1, "hour")
Result: 1970-01-01 09:00:00
Extend all memberships by 3 days and 12 hours.
UQLupdate().nodes({@membership}).set({ expiry: dateAdd(dateAdd(expiry, 3, "day"), 12, "hour") })