-   Linux - Hardware (
-   -   hardware clock time differs from system time after setting (

maxgsp 02-26-2009 09:49 AM

hardware clock time differs from system time after setting
I'm setting the hardware clock on RHEL 5.1 system using /sbin/hwclock --systohc. After setting the clock I issue a date command followed by a /sbin/hwclock --show from within a script to get fast resolution and I see that the hardware clock precedes the system time on average by .5 seconds. Does anyone have any idea why this would happen and how to fix it? I would think the clock should be identical after setting. thanks

blackhole54 02-27-2009 05:24 AM

This might have something to do with the hwclock command waiting for a tick and not be a problem at all. To see what I am talking about:


hwclock --debug --show
(The --debug option is what most commands would call "verbose.")

I am not sure how you are determining it is, on average, 0.5 seconds behind since, TMK, the date command only has a resolution of 1 second. I do note that 0.5 seconds is the average of all possible values from 0 to 1 second.

EDIT: And please don't post the same question in more than one place. There is a reason that is against LQ rules ...

All times are GMT -5. The time now is 05:00 AM.