A SERVICE OF

logo

Chapter 7 551
Command Definitions S-SO
SETCLOCK
This list is only meant to include a few of the dangers associated with an immediate time
change; this list does not represent all of the problems likely to be encountered.
Therefore, if the ;NOW option must be used, it should be used only with a full
knowledge of its effects on the system's workload.
Use
This command may be issued from a session, job, program, or in BREAK. Pressing Break
has no effect on this command.
Diagnostician (DI) and either Operator (OP) or System Manager (SM) capabilities are
required to issue this command. Additionally, System Manager (SM) capabiltiy is required
to use the ;NOW parameter.
Examples of Date-Time and Correction Forms:
The following example illustrates setting the system time by providing a date and time:
:SETCLOCK DATE=07/04/1993;TIME=15:00
The following example illustrates providing a time correction to advance the system time
by one hour.
:SETCLOCK CORRECTION= +3600
or
:SETCLOCK CORRECTION= 3600
Both of the above examples cause Universal Time (GMT) to change as well as local time,
and therefore while they are useful in correcting the system time for drift (time gain or
loss), they are not accurate ways to change time zones.
The following example illustrates setting a time correction, executing a SHOWCLOCK
command, cancelling the correction, then again executing a SHOWCLOCK command. Note
that by the time of the first SHOWCLOCK the correction has already begun to be consumed.
:SETCLOCK CORRECTION= -3600
:SHOWCLOCK
SYSTEM TIME: FRI, JUL 24, 1987, 8:47:35 AM
CURRENT TIME CORRECTION: -3568 SECONDS
TIME ZONE: 7 HOURS 0 MINUTES WESTERN HEMISPHERE
:SETCLOCK; CANCEL
CORRECTION OF -3550 SECONDS HAS BEEN CANCELLED
:SHOWCLOCK
SYSTEM TIME: FRI, JUL 24, 1987, 8:52:53 AM
CURRENT TIME CORRECTION: 0 SECONDS
TIME ZONE: 7 HOURS 0 MINUTES WESTERN HEMISPHERE
Note that in the example above the system clock was slower than normal for several
minutes. Cancelling the correction did not undo that change; it merely prevented any
further time change. Thus after this sequence of commands, the system clock is set to a
slightly earlier time than if no SETCLOCK command had been issued.