John writes:
> Here's what I got with SHOWCLOCK:
>
> SYSTEM TIME: THU, JUN 11, 1998, 1:47:41 PM
> CURRENT TIME CORRECTION: 0 SECONDS
> TIME ZONE: 333 HOURS 0 MINUTES EASTERN HEMISPHERE
>
> It looks bad, huh? I am just a lowly applications programmer, and a
Yep...solution below.
From my HP3000-L posting of April 17...
Steve Cooper demonstrated a method of getting both the hardware clock
and software clock and GMT offset "fixed" without rebooting.
I turned it into a command file, and it worked for the two simple
test cases I tried...
If your local time is correct, and you want to fix the hardware clock
(and GMT time), this command file may be simpler than shutting
down, using CLKUTIL, and rebooting.
Usage:
If you're in California, and your local time is correct, you can
fix the GMT by doing:
fixclock 7
If you're in California, and your local time is wrong (and the
GMT offset is also wrong), you can fix everything by doing:
setclock date=mm/dd/yy;time=hh:mm; now
Note that ";NOW" may have repercussions in various places.
and then
fixclock 7
SS
----------------cut here for FIXCLOCK.CMD---------------------------
parm gmt_offset_hours = 99, gmt_offset_minutes = 0
comment FIXCLOCK.CMD version 98A
comment written by Steve Cooper and Stan Sieler 1998-04-17
if !gmt_offset_hours = 99 then
echo
echo This command has one required parameter: the number of
echo hours your local time is offset from GMT.
echo If you are in California, for example, the
echo offset is 8 hours for PST, and 7 hours during PDT.
echo
echo The second (optional) parameter is the additional
echo number of minutes your local time is offset from GMT.
echo
echo Thus, if you should be 3:30 off from GMT (e.g., in
echo Newfoundland regular time):
echo fixclock 3, 30
echo
echo If you are in California *and* it's now Daylight Savings Time,
echo fixclock 7
echo
echo If you are EAST of GMT, use negative numbers.
echo
return
endif
if (!gmt_offset_hours > 23) or (!gmt_offset_hours < -23) then
echo
echo Sorry, gmt_offset_hours must be in the range -23..23
error
return
endif
if (!gmt_offset_hours < 0) or (!gmt_offset_minutes < 0) then
setvar _prefix "E"
if (!gmt_offset_hours < 0) and (!gmt_offset_minutes > 0) then
echo
echo Sorry, the hours and minutes must both be <= 0
error
return
endif
else
setvar _prefix "W"
endif
setvar _orig_date "!hpmonth/!hpdate/!hpyear"
setvar _orig_time "!hphour:!hpminute"
comment there is no hpsecond
comment the following assumes everything works :)
setclock timezone=!_prefix!gmt_offset_hours:!gmt_offset_minutes
setclock ; cancel
comment the "cancel" doesn't undo the timezone change!
setclock date=!_orig_date; time=!_orig_time; now
showclock
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler.html
|