SYS_DATE_PHYSICAL

Use the SYS_DATE_PHYSICAL script function to retrieve the current date at the time of processing. The script function lets you specify a date format and optional time zone.

Tip: When your script calls this function multiple times and the date changes between the calls, the retrieved dates will differ. If you need the date to remain the same throughout the script, use SYS_DATE.

Syntax

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

Parameters

Notes:

Examples

The following example determines the date, and stores the value in a script variable. The script specifies DD.MM.YYYY as the date format for the retrieved date.

:SET  &DATE# = SYS_DATE_PHYSICAL('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_PHYSICAL(&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_PHYSICAL() = '990101'  
!...
 
:
ENDIF

The following example specifies a date format and a Time Zone object, and prints the retrieved date in the activation report.

:SET  &DATE# = SYS_DATE_PHYSICAL('YYYY-MM-DD','TZ.MEZ')
:
PRINT  &DATE#

See also:

seealso

Script Elements for System Conditions and Settings