System Clock Always Off!
I have installed Slackware 14.1 (64-bit) on a desktop that has an Intel DQ965GF motherboard.
The BIOS does not have a UTC setting for the hardware clock, so I was extra careful to select "Hardware clock is set to local time" while installing Slackware. I also made sure to select the correct time zone where I live. And yet, every time that I boot up the system clock is off by +6 hours! I am not much of a Linux expert and hope that somebody on this forum will offer some guidance towards solving this annoyance. Thanks. |
Is the BIOS battery low or dead?
Is this computer connected to the internet? if so just use NTP to correct the time. |
Quote:
KDE control module has a check mark in the box "Set date and time automatically" and the time server selected is pool.ntp.org, if that's what you are talking about. |
Does the output of 'date' coincide with the KDE time ?
|
Known problem.
If you run ntpd on recent kernels your system (BIOS) clock will be reset to UTC even though the options are turned off in the kernel config. The only real fix is to patch the kernel config directly and then recompile it. See patch here :- http://www.linuxquestions.org/questi...ml#post5039950 |
Quote:
|
Quote:
|
Until you try to use SSL and it fails as the clock is too far out.
Though you haven't stated if you are or are not running ntpd. If you are running it what does ntpq tell you about the clock and sync. |
Are there any other OSes installed on that box?
If not, why not just set the hardware clock to UTC (using the 'timeconfig' utility). |
As root, what is the output of ...
Code:
# hwclock --debug ; date |
I was having this problem too, even with rc.ntpd marked as executable and all KDE configurations right.
My solution was put this on rc.local Code:
if ntpdate 200.20.186.75; then I don't know if will work for every country. |
Quote:
You can also get odd time problems if you multiboot and one of the distributions uses local time while the other uses UTC. If that is the case, set both to the same time. By the way, I have an old computer that thought it was 1997 when I started it (it was 2013). Bad battery. |
Quote:
I have dual boot whit Slackware and XP, I have to admit that I didn't boot XP to see if the date was right there. I didn't boot XP before the problem too, so it isn't the cause. The command "ntpdate" retrieves time from server and writes to system clock. "hwclock -w" writes it to the hw clock, like you said. So far that solution worked for me, this is because I didn't investigate the original problem with more details. Maybe something wrong with ntpd or KDE settings, or with my hardware :D aside battery, I changed it when the problem started. |
Two things you may want to do:
Code:
# Understand that your hardware clock and your system clock are two separate things; the hardware clock (on your motherboard) is an actual clock chip similar to your wristwatch, it's run by a battery. The system clock is software, run by interrupts in the kernel. You want to use NTP to keep the system clock on-time. You want to use three pool servers so NTP can evaluate which of those servers is the "best" (meaning the delay, offset and jitter are the lowest available). NTP will switch between servers, selecting the best one, it will also throw out one or more periodically and select a new server if one or more become unavailable, noisy, or poor choices -- it does this without any input from you. Also, if your Internet connection goes away for a while it will synchronize to your local host until the connection comes back and resynchronize to one of the pool servers stepping the system clock back into the correct time. Now, if NTP was running, stop it with Code:
/etc/rc.d/rc.ntpd stop Code:
/usr/sbin/ntpq -pn Code:
remote refid st t when poll reach delay offset jitter This all supposes that your time zone is correct when NTP started. Note that /etc/rc.d/rc.ntpd has an argument that will do large correction to the system clock at boot time (at boot, time is read and initially set from the hardware clock, at shutdown, time is saved from the system clock to the hardware clock). Don't monkey with that. There is no reason, if you turn off XP's daylight time adjustment as above to not have your hardware clock at UTC (all my servers are UTC and I have absolutely no problems with NTP keeping things on-time). As others have described above, you can set your hardware clock from your system clock (you could also set it to the correct time UTC in the BIOS if your want to fiddle with that). Just make sure that you have the time configuration set (you may want to run [I]timeconfig/I], choosing UTC and your local time zone in console (without KDE running) or you could choose to set both clock to local time. Either way, NTP will keep your clocks synchronized. Don't monkey with time settings in KDE, it should default to what your system configuration settings are. You may -- may! -- need to shut down, boot into BIOS and set that clock to close-to-correct wall or UTC time then boot to run level three (console, not KDE) to do these things. If you choose UTC, remember that EST in the US is UTC+5 or whatever your time zone is (it's 0812 EST, 1312 UTC right now here). If you've fiddled with settings in KDE, unfiddle 'em and let the system do its thing for you. Hope this helps some. |
All times are GMT -5. The time now is 02:03 AM. |