John Aldrich wrote:

> On Thu, 02 Nov 2000, Bret Hughes wrote:
> >
> > if the hwclock is utc I believe you need to use th -u switch to hwclock. I
> > have started using setclock with great results. Seems like I found it from
> > reading the init scripts but I forget.
> >
> Hmm...interesting I've never had to use the "-u" switch. :-)
> According to the MAN page, -utc switch means to put it INTO UTC
> mode. If you want to use *local* time, use the "-localtime" flag
> instead. Thereafter it'll default to "localtime" unless/until you
> re-run hwclock with the "-utc" flag.
>         John

Huh, that is not how I interpreted it:  Fom the manpage on a 6.0 box

--utc  Indicates  that the Hardware Clock is kept in Coor-
              dinated Universal Time.  It is your choice  whether
              to  keep your clock in UTC or local time, but noth-
              ing in the clock tells  which  you've  chosen.   So
              this  option  is  how  you give that information to
              hwclock.

              In order to avoid any  possible  misunderstandings:
              all  conversation  with the program hwclock is done
              in local time. If you have your clock in UTC (as is
              common  on  a  Unix  system)  then the option --utc
              tells hwclock to do  the  appropriate  conversions:
              `hwclock  --show  --utc'  will  tell  you the local
              time, assuming the hardware clock is  in  UTC,  and
              `hwclock  --set  --date="XXX"  --utc'  will set the
              hardware clock to the UTC equivalent of  the  local
              time XXX.

[root@compaq2 sysconfig]#cat /etc/sysconfig/clock
UTC="yes"
ARC=false

root@compaq2 /etc]# ls -al localtime
lrwxrwxrwx   1 root     root           32 Nov  2 18:38 localtime ->
../usr/share/zoneinfo/US/Central


let's try a few things
[root@compaq2 sysconfig]# hwclock --show
Fri Nov  3 00:10:30 2000  -0.705657 seconds
[root@compaq2 sysconfig]# date
Thu Nov  2 18:10:31 CST 2000
[root@compaq2 sysconfig]# hwclock --show -u
Thu Nov  2 18:10:42 2000  -0.081518 seconds

now lets change the clock
[root@compaq2 sysconfig]# hwclock --show
Fri Nov  3 00:14:00 2000  -0.060926 seconds
[root@compaq2 sysconfig]# date
Thu Nov  2 18:14:01 CST 2000
[root@compaq2 sysconfig]# hwclock --systohc
[root@compaq2 sysconfig]# hwclock --show
Thu Nov  2 18:14:41 2000  -0.034053 seconds

The hwclock is now set to the system time with no UTC offset

Now lets set it using the -u option

[root@compaq2 sysconfig]# hwclock --systohc -u

Now lets look at the raw rtc time
[root@compaq2 sysconfig]# hwclock --show
Fri Nov  3 00:14:58 2000  -0.805199 seconds

now lets look at it while telling hwclock that the rtc is using UTC
[root@compaq2 sysconfig]# hwclock --show -u
Thu Nov  2 18:15:02 2000  -0.386650 seconds
[root@compaq2 sysconfig]# date
Thu Nov  2 18:15:01 CST 2000


At least on my 6.0 servers with all the errata updates this is the behavior I
am used to seeing.  Maybe there is some thing I am missing but I pulled my hair
out over this stuff a couple of years ago for a while 'til I felt like I got it
right.


If this is incorrect I would greatfully accept correction. (given the proper
offset of course)

Bret



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to