Quote:
Originally Posted by louigi600
I use this on all my systems to put the time right (even when it's way off)
|
On a Slackware ARM system I'd use this;
Code:
root@slackware:~# ntpdate -b 0.pool.ntp.org
Or this;
Code:
root@slackware:~# ntpd -b 0.pool.ntp.org
When no network connection is available I'd set the date/time manually and use this;
(Example used is midday on Sunday, April 01 2018)
Code:
root@slackware:~# date 040112002018.00
Or this;
Code:
root@slackware:~# date -s "Sun Apr 01 12:00:00 2018"
If accurate time is always a consideration then I'd recommend to
setup a Raspberry Pi as a NTP server. If you have a spare RPi device laying around it would be a perfect use for it. I did exactly that and use this RPi to set the date/time on all my computer systems around the house.
Code:
root@vuur:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
LOCAL(0) .LOCL. 10 l 115d 64 0 0.000 0.000 0.000
192.168.10.71 .XFAC. 16 B - 64 0 0.000 0.000 0.004
*glfd-dmzutil-1. 10.178.1.162 2 u 1073 1024 377 24.842 -2.101 2.248
+ntp0.nl.uu.net .GPS. 1 u 793 1024 377 19.515 -0.450 0.976
-turnip.mc.man.a 193.62.22.74 2 u 919 1024 377 31.140 -1.059 0.737
+139.59.199.215 82.69.223.180 2 u 1018 1024 377 20.305 -3.778 1.318
root@vuur:~# date
Mon Apr 2 07:49:17 BST 2018
From another system on the network I just do this:
Code:
root@drie:~# ntpdate -b 192.168.10.71
2 Apr 07:50:09 ntpdate[4179]: step time server 192.168.10.71 offset 0.002963 sec
root@drie:~# date
Mon Apr 2 07:50:16 BST 2018
I have a slight addiction to RTCs and have collected quite a sum of them over the years. Of which, I've found the DS3231 to be the best by far and have them installed in almost all my RPis. A real time clock is always good for a back-up solution, whether it's ever needed or not.
"
Time is the school in which we learn,
Time is the fire in which we burn."
[Delmore Schwartz]