SYS_DATE

Use the SYS_DATE script function to retrieve the current date. The script function returns the date at the beginning of script processing, and freezes that date for the rest of the processing.

Tip: Use SYS_DATE_PHYSICAL to retrieve the current date at the actual time of processing.

Syntax

SYS_DATE ([Date format][,Time Zone|UTC])

Parameters

Notes:

Important! When you use a :PUT_VAR script statement to transfer the current date to a VARA object that has the data type timestamp, use one of the following date formats:

Note: (Windows only) The date format is not saved after saving to the VARA object. The displayed date format is determined by the regional options defined in the control panel of Windows.

Examples

In the following example, the script retrieves the current date and specifies a date format. The retrieved date is stored in a script variable

:SET &DATE# = SYS_DATE("DD.MM.YYYY")

The following example specifies a calendar week date format to retrieve the current day of the week.

:SET &FORMAT# = "WW"
:
SET &WEEKDAY# = SYS_DATE(&FORMAT#)

The following example does not specify a date format. The script uses the current date in the default YYMMDD format to define a condition.

:IF SYS_DATE() = "990101"
!...

:
ENDIF

The following example retrieves the current date and stores the value in a VARA object that has the data type timestamp. The script uses a Time Zone object that is configured for Central European Time.

:SET &DATE# = SYS_DATE("YYYY-MM-DD","TZ.CET")
:
PUT_VAR BOOKING.DATE, , &DATE#

See also:

seealso

Script Elements for System Conditions and Settings

Script Elements for Workflows and Tasks in Workflows