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

  • SYS_DATE_PHYSICAL
    Returns the current date

  • Date format
    (Optional) Date format for the retrieved date
    For more information, see Date, Time and Period Formats in Scripts.
    Format: script literal or script variable
    Default: YYMMDD

  • Time Zone or UTC
    (Optional) Specifies the time zone for the date
    Format: script literal or script variable
    Allowed values:

    • Name of a Time Zone object
      For more information, see Time Zone (TZ).
      Format: script literal or script variable
    • UTC
      Returns the date in UTC (Coordinated Universal Time)

Notes:

  • The Time Zone defined in the object attributes applies, unless you specify a different Time Zone.
  • If the object has no defined Time Zone, or if you specify a non-defined Time Zone object, then the Time Zone defined for the Client applies.

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: