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 objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task or keyword UTC |
Return code |
---|
Current time in the specified format |
This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… 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 clientA closed environment within an Automation Engine system where you can create and run objects. A client name consists of a 4-digit number that must be indicated when a user logs on to the Automation Engine system. Users and their rights are also defined in clients. A particular Automation Engine object type. 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 variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type.. 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
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |