ADD_DAYS

Use the ADD_DAYS script function to add days to a given date. This function lets you optionally calculate the date depending on Calendar Events that are defined in a Calendar object.

Syntax

ADD_DAYS ([Date Format:]Date, Days[, Calendar, Calendar Event])

Parameters

Return Codes

This script function has the following return codes:

Note: The calendar calculation automatically considers the range of the specified calendar. The calendar range depends on the Client settings NOW_MINUS and NOW_PLUS. For more information, see UC_CLIENT_SETTINGS - Various Client Settings.

Examples

The following example adds two days to the specified date. The date is in the default YYMMDD format. The script prints the result (000401) in the activation report.

:SET &DATE# = ADD_DAYS("000330", 2)
:
PRINT &DATE#

The following example assigns the current date to a script variable, and uses the default YYMMDD date format. The script prints the result (000401) in the activation report.

:SET &DATE1# = "000330"
:
SET &DATE2# = ADD_DAYS(&DATE1#, 2)
:
PRINT &DATE2#

The following example retrieves the current date in a format that is not the default date format for ADD_DAYS. The ADD_DAYS function retrieves the next valid work day by using the definitions made in a Calendar object that is called COMPANY. The special date format is specified in the parameters of the ADD_DAYS function.

:SET &CURDATE# = SYS_DATE("DD.MM.YY")
:
SET &NWRKDAY# = ADD_DAYS("DD.MM.YY:&CURDATE#", 1, COMPANY, WORKDAY)

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts