Script Function: Determines the current time of a day
SYS_TIME_PHYSICAL([Time Format], [TimeZone])
Syntax |
Description/Format |
---|---|
Time Format |
Format for the determined time |
TimeZone |
Name of a TimeZone object or keyword UTC |
Return code |
---|
Current time in the specified format |
This script function determines the current time of a day. A TimeZone that has been specified in the form of a parameter is considered in this calculation.
Note: Repeated usage of this script function within a script may result in differing results (e.g. in queries to the second or minute). Thus, the script function differs from SYS_TIME which determines the time at the start of script processing and then keeps this time in order to ensure the consistency of the script.
TimeFormat is optional. It serves to determine the format in which the value should be returned. The default format "HHMMSS" is returned if no TimeFormat is specified.
TimeZone is also an optional parameter. If the script function is called without it, the object's TimeZone is used, or that of the client if none was defined for the object. If a non-defined TimeZone is specified, the default value (client's TimeZone) is used. The keyword UTC may be used instead of a TimeZone. The time is then returned in UTC (Coordinated Universal Time).
The first example determines the current time of date and supplies the values to script variables. The results are two times which are separated by at least ten second.
:SET &TIME1# = SYS_TIME_PHYSICAL("HH:MM:SS")
:WAIT 10
:SET &TIME2# = SYS_TIME_PHYSICAL("HH:MM:SS")
In the second example, the current time of day is determined in UTC. Calling up the script function a second time, a TimeZone is given which is defined for CET. The result is two times, at least 1 hour and 10 seconds apart.
:SET &TIME1# = SYS_TIME_PHYSICAL("HH:MM:SS","UTC")
:WAIT 10
:SET &TIME2# = SYS_TIME_PHYSICAL("HH:MM:SS","TZ.MEZ")
In the third example, a special term is used and assigned with a script variable. Only the minutes of the current time of day are determined.
:SET &FORMAT# = "MM"
:SET &TIME# = SYS_TIME_PHYSICAL(&FORMAT#)
If the function is used without the specification of Time Format, the syntax is as in the following example.
:IF SYS_TIME_PHYSICAL() = "120000"
!...
:ENDIF
See also:
Script element | Description |
---|---|
Returns the current time of day at the beginning of the script processing. |
|
Provides current date and time. |
Script Elements - Date and Time
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function