HP3000-L Archives

January 1997, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Holger Wiemann <[log in to unmask]>
Reply To:
Date:
Thu, 9 Jan 1997 09:38:02 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (301 lines)
Craig Vespe wrote:
>
> Hi all -
>
>    I mentioned a while back we were using SETCLOCK for year 2000 testing
>    on one of our 'crash and burn' machines.  There were quite a few
>    people using it, both developers and support people, but somehow our
>    925 got into a curious state:
>
> S925(/SYS/PUB):showtime
> SUN, OCT 28, 1934,  4:36 AM
> S925(/SYS/PUB):showclock
>
> SYSTEM TIME: WED, APR 25, 2027, 11:00:42 PM
> [...]
>
>    I'm really at a loss as to how the hardware and software clocks could
>    get so out of sync.  Now using SETCLOCK at the CI aborts the CI.  This
>    machine is still on MPE/iX X.55.20.  Any clue as to how it got so
>    confused (along with us)?
>
>    cv
> --
> Craig Vespe [log in to unmask] Unison Software 811 Barton Springs, Austin Tx.78704
> 512-478-0611 http://www.unison.com NASDAQ UNSN disclaimer quote ANSI graphics

 Hi Craig,

I can't explaine what's going on your system, but as far as I know
you have to keep in mind 4 items when altering the clocks in MPE/iX:

1. the hardware clock
2. the software clock
3. the current offset of the both above
4. the currently running time correction

By having some requests from German customers who are amazed by the
poor documentation of SETCLOCK I've written a tiny cookbock for them
which I think could help. It's for German customers but I think it's
not problem for you to adapt it for your time zone.

Regards,
Holger Wiemann, Hewlett Packard Germany

The cookbook, here we go:

                      How to set time/clocks on MPE/iX

------------------------------------------------------------------------
last update: 02-Dec-1996
------------------------------------------------------------------------
   * There are some infos you have to know when specifying correct date
     and time on a MPE/iX system. There exist two clocks and an offset:

        o Hardware Clock:

          Normally you have to set the hardware clock at Greenwich
          Meantime (GMT) on system startup with the 'clkutil' in ISL.

        o Software Clock:

          To set the software clock at your local time you have to
          specify it while system startup when you are prompted after
          'start' command from within ISL.

        o Greenwich Meantime/MPE local time Offset:

          The GMT/MPE time offset is calculated as follows:

          offset = software clock - hardware clock


          (Values of clocks at startup of the system!)

   * Most date and time routines/functions on MPE/iX are just using the
     local time. But there are some exceptions using different
     strategies to get the GMT:

        o using hardware clock

          GMT = hardware clock


          I don't know any programs really doing this

        o substracting offset from local time (software clock)

          GMT = software clock  -  offset

          As far as I know most subsystems needing GMT use this method.

        o special calculating of local time with timezone variable 'TZ'

          local time = software clock - offset + value of 'TZ'


          Value of 'TZ' can be negative (in Germany it is positive!),
          see next point Timezones. If in MPE environment the 'TZ'
          variable has a value for which an entry exists in
          TZTAB.LIB.SYS, daylight saving is taken into consideration.

          Known subsystems supporting this are COBOLII/iX, C/iX Library,
          SNMP/XL, Fortran 77/iX, Allbase/4GL and the POSIX/iX Shell
          with libraries.

   * Timezones (Western- and Eastern-Hemispheres):

     The difference between soft- and hardware clock is the timezone you
     use on your system. It's also equivalent to following model:

                  Greenwich Meantime (GMT)
                          |
     ------------------------------------------------
          negative                  positive
          deviation                 deviation
          from GMT                  from GMT
          (Western                  (Eastern
           Hemisphere)               Hemisphere)


     In Germany we have a deviation of +1 hour from GMT, with daylight
     saving this is +2 hours.

   * As you can see there are some subsystems getting their local time
     with timezone variable 'TZ'. Here is a very easy method the author
     prefers by the simple understanding:

        o Setting 'TZ' variable on MPE/iX prompt (logon UDC):

          SETVAR TZ,'EST-1'

          or

          SETVAR TZ,'EST-2'


        o Setting 'TZ' variable in POSIX/iX Shell (/etc/profile):

          export TZ='EST-1'

          or

          export TZ='EST-2'


     (This means:
        o 'EST' can be any string, here it stands for Eastern
           Hemisphere.
        o '-' specify a deviation value in the Eastern Hemisphere.
          (Leaving it out it would be in the Western one!)
        o # are absolut hours of deviation from GMT)

     So, 'EST-1' is the local time at Germany, 'EST-2' is daylight
     saving at Germany.

     Important info: If variable 'TZ' is not set, some subsystems assume
     a value of 'EST5EDT' which forces to recognize daylight saving
     entries for this in TZTAB.LIB.SYS! In POSIX/iX the unset of
     variable 'TZ' leads to GMT0!

     If you are in Germany and you don't want to doubt about of changing
     'TZ' variable in MPE and POSIX-Shell when toggling daylight saving
     you just have to set

     SETVAR TZ,'MEZ-1MESZ'


     in MPE environment and in POSXI shell

     export TZ='MEZ-01:00MESZ-02:00,M3.5.0/03:00,M9.5.0/02:00'


     (This looks a little bit complex but remember POSIX WILL NOT READ
     MPE FILE TZTAB.LIB.SYS !!!)

     In this case the correct daylight saving value in MPE environment
     is read from TZTAB.LIB.SYS. You only have to change the software
     clock gradually.

   * Setting your correct values of hard-, software clock and timezone
     gradually (this can be done on small time deviations of some
     hours):

     First check your current settings with SHOWCLKS.PUXL.TELESUP:

     SHOWCLKS/XL  A.10.00
     DEBUG/iX B.79.06

     HPDEBUG Intrinsic at: bd.00007258 PROGRAM+$198
     PRIV=$3 := $0

       *************************************************************
       ***                                                       ***
       ***   Greenwich Mean Time : MON, APR 15, 1996,  3:26 PM   ***
       ***   GMT/MPE offset      : +1:00:00                      ***
       ***   MPE System Time     : MON, APR 15, 1996,  4:26 PM   ***
       ***                                                       ***
       *************************************************************

                      **** C Library Information ****

             Current value of Time Zone(TZ) variable : EST-1
             CTIME function return :  Mon Apr 15 16:26:36 1996


     Now there are only two possible cases:

       1. Greenwich meantime is set correct but MPE/local system time is
          not. You only have to gradually adapt the local time with
          SETCLOCK TIMEZONE (example):

          SETCLOCK TIMEZONE=E02:00


          (Eastern hemisphere, 2 hour deviation. Using SETCLOCK TIMEZONE
          is the only command you need to toggle between set/unset of
          daylight saving if hardware clock is set correct!!! Don't
          forget to adapt 'TZ' variable on MPE and POSIX/iX-Shell if
          necessary!!!)

       2. Greenwich meantime and MPE system time are not set correct:
             + First set correct timezone (example):

               SETCLOCK TIMEZONE=E02:00


               (This doesn't change the hardware clock but starts a
               gradually adaption of the software clock! Don't forget to
               adapt your 'TZ' variable in MPE and POSIX-Shell if
               necessary!!!)

             + If SHOWCLOCK shows a current running time correction of
               not equal 0 (ZERO) seconds like:

               SYSTEM TIME: MON, APR 15, 1996,  5:58:14 PM
               CURRENT TIME CORRECTION:        3543 SECONDS
               TIME ZONE:    2 HOURS  0 MINUTES EASTERN HEMISPHERE


               abort this correction process with

               SETCLOCK ;CANCEL


             + Now there are two possible cases:

                 1. The local date and time you want the system to be is
                    in the future of the current local time (example):

                    :SHOWCLOCK
                    SYSTEM TIME: MON, APR 15, 1996, 18:00:14 PM
                    CURRENT TIME CORRECTION:           0 SECONDS
                    TIME ZONE:    2 HOURS  0 MINUTES EASTERN HEMISPHERE


                    You want the system to be at 04/15/1996 19:00 h:

                    SETCLOCK DATE=04/15/1996;TIME=19:00:00;NOW


                    (Hardware- and software clock are set immediately to
                    correct values!)

                 2. The local date and time you want the system to be is
                    in the past of the current local time (example):

                    :SHOWCLOCK
                    SYSTEM TIME: MON, APR 15, 1996, 18:00:14 PM
                    CURRENT TIME CORRECTION:           0 SECONDS
                    TIME ZONE:    2 HOURS  0 MINUTES EASTERN HEMISPHERE


                    You want the system to be at 04/15/1996 17:00 h!

                    First correct the hard- and software clocks to
                    values some minutes in the future of the current
                    local time:

                    SETCLOCK DATE=04/15/1996;TIME=18:03:00;NOW


                    (Hardware- and software clock are set immediately to
                    future values!)

                    Second gradually smooth local date and time to
                    correct values:

                    SETCLOCK DATE=04/15/1996;TIME=17:05:00


                    (Hardware clock is set immediately to correct GMT
                    time!
                    Software clock is gradually set to correct local
                    time)

   * For more infos using the file TZTAB.LIB.SYS which prevents you from
     changing 'TZ' variable in MPE when toggling daylight saving see:
        o HP C/iX Library Reference Manual
        o HP FORTRAN 77/iX Reference
        o HP COBOL II/XL Reference Manual

ATOM RSS1 RSS2