Time lags by exactly 3 hours always.
Slackware 14.0
Hi: the time in my computer is always lagging exactly 3 hours. I set the right time but in a very short time it is lagging again. What can be the cause? |
Since you're exactly 3 hours behind UTC, my guess is that it has something to do with that. Are you dual booting? Also, how are you setting the time?
I'd suggest using timeconfig to make sure that your timezone is correct. Then, make sure the clock is set to the proper local time. Once you've done that, use hwclock to save it to the hardware clock. If your hardware clock uses UTC: /sbin/hwclock --utc --systohc If your hardware clock uses local time: /sbin/hwclock --localtime --systohc If you happen to be dual booting, the other operating system might have a different idea about whether you are using local time or UTC. If that is the case, and if it is set to synchronize from a network clock source, that could also lead to a 3 hour offset. Similarly, a wrong timezone setting on Linux combined with network time sync could lead to the 3 hour offset whenever the sync occurs. |
I use dual booting but seldom boot the other OS. So, this can't be the cause. Also, the clock must be synchronized to some external source, and this is what I do not understand. I do not use ntpd or other network time service.
Another thing is that when in London it is, say 11pm, in my city it is 8pm. But I have 5pm! Just the same lag but opposite sign. It surely is a coincidence. |
The actual UTC time is not relevant. If your hardware clock is set to local time (8 pm), but the system is configured to think that the hardware clock represents UTC, you'll be lagging by 3 hours.
Did you try reconfiguring and then saving the time to the hardware clock? |
Yes, I did. Now I'll have to wait at least a day to be sure the clock is well. But why am I connected to an external source? Running 'ps -e|grep ntp' gives nothing. Maybe the GUI runs some network time service?
|
Quote:
Hope it works. Good luck! |
Thank you very much.
|
In order to synchronize system clock and hardware clock, both must be set to the same time.
In this article,, I found these instructions: Quote:
|
I ran timeconfig to set the time zone to my time zone, then date to set the time and 'hwclock --localtime --systohc'. Now I am periodically running 'hwclock ; date' to see which one of the clocks is lagging, if it is. It is possible that the time zone was wrong. It's the only possible explanation.
|
The timezone must have been wrong, because after running timeconfig the problem never occurred again. Now the system time is always correct, within the accuracy of the hardware clock.
|
If you are dual booting with Windows do NOT set your hardware clock to UTC.
Use localtime. Slackware will not add by default server entries to your /etc/ntp.conf file, you must add them yourself: Code:
server 2.ar.pool.ntp.org iburst is big, so you must stop it: Code:
# /etc/rc.d/rc.ntpd stop Code:
# ntpdate 2.ar.pool.ntp.org Code:
# /etc/rc.d/rc.ntpd start shut down. You can check it doing: Code:
grep hwclock /etc/rc.d/* rc.local_shutdown Code:
# echo '/sbin/hwclock --localtime --systohc' >> /etc/rc.d/rc.local_shutdown ntpd and let Windows set the time. Take in care that an old CMOS battery could be the cause of the problem. Walter |
Quote:
|
Quote:
Daylight time is coming soon (it's 10 March in the US) and your Linux system, if it's running, will switch the time. If you then boot Windows, it'll switch the time again, then you get back into Linux and your clock is all screwed up. Best solution I've found is to turn off the automatic daylight time adjustment in Windows. Other best solution is install Windows in VirtualBox (or some other virtual machine software) and you won't have the problem (Windows can't fiddle with the hardware in VirtualBox, but turn off the automatic daylight time adjustment anyway). |
Quote:
It's not exactly about using ntpd but using UTC time (like Patrick explained). Windows doesn't support UTC bios time, it will save your localtime to bios clock. When you reboot to a Linux configured to use UTC, ntpd won't sync because it can't handle big drifts. I told you not use ntpd in that case because a common alternative is running ntpdate at boot time. |
Quote:
PS: of course you have to use a certain registry setting under windows to make it assume the RTC time is in UTC |
All times are GMT -5. The time now is 08:01 PM. |