Domain: Environment information (calendar / time)
The TIME( ) function supplies the current time of day; the separator between the entries for hours, minutes and seconds can be freely selected.
Format
TIME( ) |
SEPARATOR = ‘:‘ / character ,MODE = *LOCAL-TIME / *UNIVERSAL-TIME |
Result type
STRING (<string 8..8>)
Input parameters
SEPARATOR = ’:’ / character
Determines the separator between the individual time entries; a colon (:) is used as the default. For achieving a dense output without any separators the null string is also accepted here.
“character” can be any character in the form of a C literal.
MODE = *LOCAL-TIME / *UNIVERSAL-TIME
Determines if the time is output in the local time (LOCAL-TIME) or in universal time (UNIVERSAL-TIME).
See also the GTIME macro in the “Executive Macros” manual [7] for more information on LOCAL-TIME (LT) and UNIVERSAL-TIME (UTC).
Result
hh:mm:ss
The current time, where “hh” indicates the hours, “mm” the minutes and “ss” the seconds (the colon used as the separator can be replaced by any other character).
Error messages
No error messages
Example
Output of the local time and of the UTC time:
/A = TIME() /B = TIME(MODE=*UNIVERSAL-TIME) /SHOW-VARIABLE (A,B) A = 10:46:51 B = 09:46:51