SYS_TIME_PHYSICAL

Use the SYS_TIME_PHYSICAL script function to retrieve the current time 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 time changes between the calls, the retrieved times will differ. If you need the time to remain the same throughout the script, use SYS_TIME.

Syntax

SYS_TIME_PHYSICAL ([Time format][,Time Zone|UTC])

Parameters

Notes:

Examples

The following script retrieves the current time twice, with an interval of 10 seconds between the two calls. The times are stored in script variables, in HH:MM:SS format.

:SET &TIME1# = SYS_TIME_PHYSICAL("HH:MM:SS")
:
WAIT 10
:
SET &TIME2# = SYS_TIME_PHYSICAL("HH:MM:SS")

The following script determines the current time of day in UTC. After a 10 second wait, the script uses a Time Zone object to determine the current time in the Central European time zone. The retrieved times should differ by 1 hour and 10 seconds.

:SET &TIME1# = SYS_TIME_PHYSICAL("HH:MM:SS","UTC")
:
WAIT 10
:
SET &TIME2# = SYS_TIME_PHYSICAL("HH:MM:SS","TZ.MEZ")

The following example specifies a time format to retrieve the minutes of the current time.

:SET &FORMAT# = "MM"
:
SET &TIME# = SYS_TIME_PHYSICAL(&FORMAT#)

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

:IF SYS_TIME_PHYSICAL() = "120000"  
!...

:
ENDIF

See also:

seealso

Script Elements for System Conditions and Settings