Time changes by itself after reboot

I’ve installed manjaro xfce on this older desktop computer a few days ago, and I notice that when I turn the computer on in the morning (after it was switched off during night), the system clock in the right bottom area shows incorrect time. Today when it was 13:11 pm it was showing 13:27 or something like that.

The time zone is set correctly, from what I can see (Belgrade, Serbia, CET), although I have to mention that yesterday it seemed as if manjaro forgot this setting from what I said during setup and I had to adjust it again.

I use this command to adjust the clock automatically :

sudo ntpd -qg

and now, apparently, I will have to use it every time when I start the computer after it was switched off.

Could somebody help me with this issue? It didn’t happen on this computer with any other OS, and I used to have Mint and Win7.

Have you tried… :arrow_down:

sudo systemctl enable --now systemd-timesyncd.service


Ok, I just executed that command in my terminal, and this is the output:

sudo systemctl enable --now systemd-timesyncd.service
[sudo] password for morningsun: 
Created symlink /etc/systemd/system/dbus-org.freedesktop.timesync1.service → /usr/lib/systemd/system/systemd-timesyncd.service.
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service → /usr/lib/systemd/system/systemd-timesyncd.service.

What is it supposed to do?

It’s the systemd equivalent of the ntpd functionality. It will keep your clock synchronized with an NTP server. :wink:

Oh nice :slight_smile:

But why is it even necessary? Once set up correctly, shouldn’t the system clock keep showing the correct time? After all, it relies on the hardware clock, which to my knowledge, always used to work flawlessly on this computer.

If you do not dual-boot windows then your cmos clock is skewed and from your topic it seems it runs a little faster than real time.

It is possible to have the timesyncd service correct for incorrect clock - but enabling the systemd-timesyncd is usually enough as this will set the clock when the system can connect to ntp servers.

Not necessarily, unless you have a kernel with real-time patches.

If the CMOS battery of the hardware clock dies, then your hardware clock will be without power until you switch on the computer, and then the date and time will be wrong.

Manjaro is now the only OS on this computer that I use. There’s one old Mint installation but it is encrypted and I forgot the password, so I was unable to log in. The win7 installation doesn’t exist anymore here.

Not sure what real-time patches are. :slight_smile: But this is what I see about my kernel:

[morningsun@morningsun-asus ~]$ uname -r

I think that is the most likely explanation for my clock acting up. Unfortunately. :frowning:
This computer wasn’t turned on for about 3 years in a row, so maybe that caused its clock battery to die.

The lithium cells usually used (CR2) can hold power a long time - but eventually they die too. If it is a desktop type then it is - usually - quite easy to replace the battery - it’s worse with laptops - the systemd-timesyncd is a real lifesaver

That’s not a real-time kernel. The most recent real-time kernel is 5.9.1_rt19-1, but you most likely don’t need that. Real-time kernels have special patches for time-sensitive stuff, e.g. for professional audio-/video-processing.

If the computer was not connected to the wall power all this time that it was down, then yes, chances are that the battery’s dead. But this will also mean that any custom settings in the BIOS or UEFI have been reverted back to factory defaults.

Best is to replace the battery. They’re about the size of a coin and they’re not expensive.

It was connected to the wall power all that time, but it was never switched on (on its front power button) to load the OS during the last 3 years.

The BIOS settings did seem a little strange when I looked at them, so maybe what you’re describing did happen actually. I will see if I can replace that battery myself or in some service repair shop.

Thanks you and linux-aarhus for your help. :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.