HP3000-L Archives

September 1997, Week 1

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:
Steve Dirickson b894 WestWin <[log in to unmask]>
Reply To:
Steve Dirickson b894 WestWin <[log in to unmask]>
Date:
Tue, 2 Sep 1997 14:47:00 P
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
<<I've been having trouble getting "C" routines to show the correct time
on our system. This is affecting not only routines that I've written
myself, but also third party packages that are written in C. The time
shown by SHOWTIME, SHOWJOB, FINFO, etc., all appear to be showing the
correct time, it is just "C" time that appears to be wrong.>>


In fact, your "C" time is the one that is "right"; see below.

<<I've been told that all I have to do is set the TZ variable to the
proper time zone, but when I set it to EST5DST (which should be correct
and is the default in any case) I still have the problem.>>


That's correct, assuming that the C program calls tzset() to set itself
up properly for the run-time environment. Although the actual time zone
designator is "EST5EDT", as shown when you queried the system with
:SHOWCLKS

<<When I run SHOWCLKS.PUBXL.TELESUP it seems to be showing the correct
time for "MPE System time", but shouldn't the offset be 4 hours during
daylight savings time? The "CTIME function return" is off by one hour
although it seems to be showing the correct offset as defined in the
TZTAB.LIB.SYS table.>>


Yes, and that's the source of your problem; instead of using the correct
way to change to Daylight Savings Time, i.e. the 'TIMEZONE=' form of the
:SETCLOCK command, it appears that whoever made the change on your system
did so by using one of the other methods. This caused GMT to change,
while the offset remained the same. Since the C RTL functions use GMT and
the TZ setting, they are producing a time that is essentially the
1-hour-too-far-East GMT, offset by the 4-hour difference that the TZ
variable produces when indexing into the TZTAB table. I.e., GMT is one
hour "fast, TZ+TZTAB says to subtract 4 hours this time of year, so the
result is also one hour "fast".

You need to reset your GMT offset using the 'TIMEZONE=' form of the
:SETCLOCK command, then fix the time with the 'CORRECTION=' or 'DATE=
TIME=' form, preferably from some NIST-derived accurate time source.

Steve

ATOM RSS1 RSS2