Skip to main content
Topic: How do we set easily our time/clock  (Read 1111 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How do we set easily our time/clock

On XFCE openRC, how do we set or fix time / clock as request by browser :
 "Your clock is behind" when accessing a web site?


Re: How do we set easily our time/clock

Reply #2
If you install "ntp" plus install and enable the service for your init as suggested above, to get automatic time setting, it still may not fix large errors if you don't have a network connection early enough in boot, it will only slew gently when the os is running, hence you would need to set it approximately first as detailed by the first part. If this is a desktop, perhaps check your cmos battery, often this is a coin cell and the clock runs slow when powered down when this battery starts to run out. Laptops usually  have one too but so long as the main battery is left in they will still keep time, and BIOS settings, even when disconnected from the mains.

Re: How do we set easily our time/clock

Reply #3
can you not also adjust the clock by adjusting the properties of the gui in the task bar.  most every de has that feature as well
Cat Herders of Linux


Re: How do we set easily our time/clock

Reply #5
The three bottom commands:

Code: [Select]
sudo pacman -S ntp-openrc
sudo rc-update add ntp-client default
sudo rc-service ntp-client start

worked on my freshly installed system (community openrc kde). However, it only worked then, for that session. I restarted my computer, rolled back my clock several minutes, came back on, and the same time that I set is still there.

I also can't click "set time and date automatically" in KDE, it's greyed out. But I don't really care so much about that, so long as the time sync actually works, which it doesn't seem to, unless I plug in those three commands again. How do I make it work without having to manually do it each session (if I care)? I mean, I could set up a cron job but there's probably some simple built-in thing I'm missing, and I'm also coming from Ubuntu, so I'm used to how things work there.

 

Re: How do we set easily our time/clock

Reply #6
Checking /var/log/rc.log, the service failed to start. Apparently the service craps the bed if the network isn't fully up by the time it wants to check the time, notwithstanding the "after net" dependency in the init.d file. ChatGPT suggested the kludge of adding "sleep 10" under start(). (The file is /etc/init.d/ntp-client ) This works but I feel stupid putting stupid hacks into my system so soon! Maybe that's the true art of Linux?