[CLUE-Tech] hwclock on debian

David Anselmi anselmi at americanisp.net
Wed Feb 19 08:51:45 MST 2003


Randy Arabie wrote:
[...]
> 
> Ok.  I guess I mistated that.  hwclock --show prints the time reported
> by my BIOS clock, which I have set to UTC time.
> 
> 	Wed Feb 19 13:05:36 2003 -0.241668 seconds
> 	(MST +7, as it should be)
> 
> date is not doing the converversion, it prints the same time, but sticks
> an MST in there.
> 
> 	Wed Feb 19 13:05:40 MST 2003
> 	(Dooh!  date should -7, making it 06:05:40)

I assume that you ran the above at 0605 MST today.  The two dates you 
get will be identical because both commands display in local time.  Your 
problem is that your hw clock is set 7 hours ahead of UTC.  You can use 
date to change your system time and then hwclock to update your hw 
clock.  Or you can reboot and set it via the bios setup (that may be 
best as you won't have any OS interpreting for you).

> 
>>Use hwclock --show --debug and see what it says.  It should make clear 
>>what is what.
>>
>>The real test is to touch a file and compare the time ls reports and the 
>>time date reports.  If those are the same all is well.
> 
> 
> They are the same, but date still thinks my hwclock is set to local
> time (MST).  It isn't, it is set to UTC.  Using the date -u command, it
> tells me the time is Wed Feb 19 20:11:19 UTC 2003, that's MST +7 hours.
> 
> The bottom line is, I need to know how to tell date that my hwclock is
> now set to UTC, not MST.

Date doesn't use your hwclock, it uses the system clock in the kernel.

> I thought changing the UTC=yes in /etc/default/rcS would take care of
> that, but it hasn't (BTW, I did reboot after that change).

Seems to me that is all that's required.  But there is no need to change 
the time by hand in this case, the boot scripts handle everything for you.

If you're still confused, post the output of hwclock --show --debug.

Dave




More information about the clue-tech mailing list