How To Fix The Clock In Slackware

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,366
Reaction score
1,744
Credits
19,522
Many times I have tried fixing the clock in Slackware and for some reason timeconfig didn't work for me at all.

I found a way to fix the clock and it works every time the clock is wrong.

Open the terminal as root and run these commands one at a time.

date -s "12:00:00"

ntpdate time.nist.gov


Finally to make the new set right time permanent also for the BIOS battery clock issue

hwclock --systohc

Most of the time I don't have to run "hwclock --systohc" because it fixes it'self after running ntpdate time.nist.gov.
 


HuMJohn

Member
Joined
May 25, 2017
Messages
32
Reaction score
50
Credits
31
Here is a much simpler method to do the same thing. As root, enter "netdate time.nist.gov"
That will sync your hardware and running clocks to the time server at nist with one command. If you leave your system running day and night, you may want to put that into a cron job to run, say, daily or weekly, depending on the amount of correction you may need.
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,366
Reaction score
1,744
Credits
19,522
Here is a much simpler method to do the same thing. As root, enter "netdate time.nist.gov"
That will sync your hardware and running clocks to the time server at nist with one command. If you leave your system running day and night, you may want to put that into a cron job to run, say, daily or weekly, depending on the amount of correction you may need.
Got it, thanks!

I'll have to learn about cron jobs as I'm not sure what file I would edit to add a job.
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,366
Reaction score
1,744
Credits
19,522
I have Slackware 14.2 installed on a 64-bit Sony laptop and the time runs 10 min's fast every month.
Any ideas why this is happening?
 

HuMJohn

Member
Joined
May 25, 2017
Messages
32
Reaction score
50
Credits
31
I have Slackware 14.2 installed on a 64-bit Sony laptop and the time runs 10 min's fast every month.
Any ideas why this is happening?
The hardware clock is, basically, a crystal oscillator and a counter/timer. If the crystal frequency is off, then the period between counts are not what is expected. I would say that the oscillator that is your hardware clock circuit is running a little fast. This happens often in older laptop designs, as they age.
I used to have a laptop that I kept on top of a file cabinet and was using that as my file and print server. It used to gain 16 seconds a day. (That is almost the amount of time you are experiencing. :) ). I ran a cron job to go out to a time server to get the correct time, every morning, timed before I powered up my office. This piece of ancient history, was about 14-15 years ago. Today, my file server (NAS) is a Raspberry Pi 3B+.
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,366
Reaction score
1,744
Credits
19,522
My Sony laptop is about 5 years old so it looks and sounds like from your description; the oscillator is fast.
Thanks for the info. HuMJohn.

Strangely this only happens with Slackware.
I've had Linux Mint and Fedora installed on my laptop in the past and the time didn't run fast. Go figure:-
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,366
Reaction score
1,744
Credits
19,522
Alexzee, I believe that Linpassion wanted to say 'substituted'.
ok, thanks.

With my brand new build I only had to fix the time once with 'timeconfig' and set the clock to UTC and it's running well now.

Happy Holidays!
Alex
 

Members online


Latest posts

Top