Bug 17127 - hwclock 2.4c
hwclock 2.4c
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: util-linux (Show other bugs)
6.2
i386 Linux
high Severity high
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-31 07:17 EDT by Zdenek Havelka
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-16 09:36:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Zdenek Havelka 2000-08-31 07:17:19 EDT
I have timezone set to Europe/Prague, and I have UTC time in CMOS.

Correct way to update CMOS before shutdown was "hwclock --systohc --utc" in
older version (on my Debian 2.1 with hwclock 2.4). 

New version of hwclock has a new option "--localtime", but works messy both
on Debian 2.2 & RH6.2:

Debian 2.1 (hwclock 2.4/util-linux 2.9g):
# date;date --utc;hwclock;hwclock --utc
Thu Aug 31 12:21:59 CEST 2000
Thu Aug 31 10:21:59 UTC 2000
Thu Aug 31 10:22:05 2000  -0.430333 seconds
Thu Aug 31 12:22:06 2000  -0.977862 seconds

Debian 2.2 (hwclock 2.4c/util-linux-2.10f):
# date;date --utc;hwclock;hwclock --utc;hwclock --localtime
Thu Aug 31 12:44:25 CEST 2000
Thu Aug 31 10:44:25 UTC 2000
Thu Aug 31 10:44:31 2000  -0.194644 seconds
Thu Aug 31 12:44:32 2000  -0.993779 seconds
Thu Aug 31 10:44:33 2000  -0.994312 seconds ????

RH6.2 (hwclock 2.4c/util-linux-2.10f):
# date;date --utc;hwclock;hwclock --utc;hwclock --localtime
Thu Aug 31 12:29:05 CEST 2000
Thu Aug 31 10:29:05 UTC 2000
Thu Aug 31 10:29:07 2000  -1.033690 seconds
Thu Aug 31 10:29:08 2000  -0.987130 seconds !!!
Thu Aug 31 08:29:09 2000  -0.933555 seconds !!!

Is there any problem in hwclock now (after new option --localtime was
added) ?
Comment 1 erik 2000-11-09 07:17:29 EST
> # date;date --utc;hwclock;hwclock --utc;hwclock --localtime
>   Thu Aug 31 12:29:05 CEST 2000
>   Thu Aug 31 10:29:05 UTC 2000
>   Thu Aug 31 10:29:07 2000  -1.033690 seconds
>   Thu Aug 31 10:29:08 2000  -0.987130 seconds !!!
>   Thu Aug 31 08:29:09 2000  -0.933555 seconds !!!

This appears almost correct. 

* Your local time is 12:29
* UTC is 10:29
* Your hw clock is set to 8:29, which is wrong
* hwclock defaults to assuming your RTC is in UTC, which it isn't.  So when you
display the hardware time it adds 2 hours in order to display in local time. 
That gets you to 10:29
* If you tell hwclock that your RTC is in local time then it doesn't do anything
to the time got from the hardware, just displays it.  That gives you a display
of 8:29, which is what your hardware clock is set to.

I think --utc and --localtime don't do what you think they do.  You think they
change the display of the time, but time is always displayed in local time. 
What they change is what they expect to find in the hardware clock.

Your problem is perhaps that hwclock used to default to --localtime, but now it
looks in adjtime for the default.  So if you used it without options the
behaviour changed.
Comment 2 Need Real Name 2000-11-09 08:09:43 EST
ok

Note You need to log in before you can comment on or make changes to this bug.