HP 3000 Manuals

Introducing SETCLOCK and SHOWCLOCK, Two New CI Commands [ COMMUNICATOR 3000 MPE/iX General Release 5.0 (Core Software Release C.50.00) ] MPE/iX Communicators


COMMUNICATOR 3000 MPE/iX General Release 5.0 (Core Software Release C.50.00)

Introducing SETCLOCK and SHOWCLOCK, Two New CI Commands 

by Doug Perry 
Commercial Systems Division 

Overview 

SETCLOCK and SHOWCLOCK are two new CI commands that help you manage and
show information about the system clock.  Now the system manager or
operator can change and obtain information about the system time and time
zone without rebooting the system.

Background 

On the HP 3000, the system time traditionally was considered a protected
system resource, only to be changed during a system boot.  A few of the
reasons are as follows:

   *   Operating System Issues:

       System accounting (the reporting of user CPU seconds and connect
       minutes) depends on the system clock, and this information is used
       to bill users for computer services on some systems.

       Some database logging and recovery systems rely on transaction log
       files that are circular files of timestamped records.  The end of
       data is detected when the recovery program observes an
       out-of-sequence timestamp.  Thus, if the time were to be set
       backwards while logging was in progress, some transactions might
       not be recoverable with such a system.

   *   User Application Issues:

       Any application relying on the forward progression of time may
       give inconsistent results if the system time were to be set
       backwards.  An automated teller application, for instance, may
       timestamp a customer making a withdrawal before a deposit, when in
       fact the customer made the deposit first.

       A file backup system that relies on the access time or
       modification time of files may not back up the expected files if
       the system time is changed.

       Any application that times external events (such as the times
       employees clock in or out) may give inaccurate data if the system
       time is set forward or backward.

The above list is certainly not exhaustive, but it does hint at the
importance of protecting the system time as a valuable resource.  Still,
many users have requested the ability to change the system time in a
supported way without having to reboot the system.  The SETCLOCK and
SHOWCLOCK commands satisfy these requests.  SETCLOCK provides a safe way
to change the system clock while the system is running, and SHOWCLOCK
provides information about system time, current time correction
(described below), and time zone.

How SETCLOCK Changes System Time 

SETCLOCK changes the system time by introducing a time correction into
the system.  This correction is gradually consumed.  If the correction is
positive, the system clock appears to speed up; if the correction is
negative, the system clock appears to slow down.  At no time does the
system time actually appear to go backwards.  When the correction is
completely consumed, the system clock appears to resume its normal pace.
This correction is consumed gradually; up to two hours may be necessary
to achieve a correction of one hour.

To establish this correction, SETCLOCK accepts either a new date and time
or a time correction (in seconds) as a parameter.

SETCLOCK also enables you to set a new time zone, which is the difference
between local time and Universal Time (Greenwich Mean Time).  Such a
change occurs when going between Standard and Daylight Savings time.  The
purpose in changing time zones is to achieve a change in local time (to
the new time zone) without changing Universal Time.

When a new time zone is requested, the behavior of local and Universal
Time on the system is complex and is different for a forward or backward
change in local time.  The difference is necessary to assure that no
out-of-sequence timestamps occur in either local or Universal Time
regardless of the direction of the time zone change.  Please see the
technical article, "Using the SETCLOCK Command", in Chapter 10 of this
Communicator for specific information on the behavior of local and
Universal Time when the time zone is changed.

SETCLOCK requires that you have both diagnostician (DI) and either
operator (OP) or system manager (SM) capabilities.  In addition, if you
have SM capability, an option to SETCLOCK permits you to immediately
change the system time either forwards or backwards.  For the reasons
stated above, such an immediate change can have very serious
consequences, but the capability is there for situations that require it.

How SHOWCLOCK Reports System Time 

SHOWCLOCK is similar to SHOWTIME in that it reports on the system time
and requires no parameters.  An example of SHOWCLOCK is given below:

     :SHOWCLOCK 

     SYSTEM TIME: FRI, JUL 24, 1987,  8:47:35 AM
     CURRENT TIME CORRECTION:  -3600 seconds
     TIME ZONE: 7 HOURS 0 MINUTES WESTERN HEMISPHERE

You can see that SHOWCLOCK displays system time including seconds,
whereas SHOWTIME only shows hours and minutes.

The current time correction in this example indicates that a SETCLOCK
command was issued and the system clock appears to run slightly slow for
awhile until the 3600-second correction is consumed.  When the clock
returns to its normal pace, the system time will be an hour slower than
if the correction had not been established.

The time zone of 7 hours in the Western hemisphere places the system
either at Pacific Daylight Savings Time or Mountain Standard Time,
depending on the time of year.

For more information about these two commands, please refer to the
article, "Using the SETCLOCK Command," in the "Technical Articles"
chapter in this Communicator.



MPE/iX Communicators