Guardian Programmer's Guide

Table Of Contents
Managing Time
Guardian Programmer’s Guide 421922-014
18 - 26
Checking the System Clock
Modify an existing transition in the DST table (DST_TRANSITION_MODIFY_
procedure )
Query a transition from the DST table (DST_GETINFO_ procedure)
The following paragraphs describe how to perform these operations.
Checking the System Clock
You can check the system time either by issuing the TIME command at the command-
interpreter prompt or by calling the TIME procedure.
The TIME command displays the date and time on the terminal as follows:
1> TIME
April 13, 1990 9:43:03
The TIME procedure returns the date and time in integer variables representing the
year, month, day, hour, minute, second, and fraction of a second in 0.01-second units.
For example:
INT DATE^AND^TIME[0:6];
.
.
CALL TIME(DATE^AND^TIME);
On return from the TIME procedure, DATE^AND^TIME contains the following
information:
DATE^AND^TIME[0] Gregorian year (for example, 1990)
DATE^AND^TIME[1] Month of the year (1 to 12)
DATE^AND^TIME[2] Day of the month (1 to 31)
DATE^AND^TIME[3] Hour of the day (0 to 23)
DATE^AND^TIME[4] Minute of the hour (0 to 59)
DATE^AND^TIME[5] Second of the minute (0 to 59)
DATE^AND^TIME[6] Hundredth of the second (0 to 99)
The time displayed by the TIME command or returned by the TIME procedure is the
local civil time as given by the CPU in which the command or procedure runs. It is
because of the clock-averaging algorithm discussed above that this value can be
equated with system time.
Setting the System Clock
All RVUs support the SETSYSTEMCLOCK procedure. Beginning with the J06.14 and
H06.25 RVUs, the SYSTEMCLOCK_SET_ procedure is supported, and called by the
SETSYSTEMCLOCK procedure. The only difference between the old and new
interface is the way errors are reported. SETSYSTEMCLOCK returns a condition
code ( < or = in TAL, a _cc_status value in C/C++); SYSTEMCLOCK_SET_ returns
an integer, with a unique value for each error. However, for callers in native C/C++, the
_cc_status value is actually an int; the same distinct error codes are available
through SETSYSTEMCLOCK. Only TNS or pTAL programs need to call
SYSTEMCLOCK_SET_ explicitly to see the distinct error results. For details of the