Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] setting system time
Date: Fri, 09 Apr 2021 00:42:26
Message-Id: ff01aac9-3d98-565e-085d-07b2054e45ce@sys-concept.com
In Reply to: Re: [gentoo-user] setting system time by Dan Egli
1 On 4/8/21 6:24 PM, Dan Egli wrote:
2 > On 4/8/2021 6:07 PM, thelma@×××××××××××.com wrote:
3 >> Try to set system clock via script:
4 >>
5 >> /usr/sbin/htpdate 1.ro.pool.ntp.org
6 >> /sbin/hwclock -w
7 >>
8 >> But when I run it always prints:
9 >> Offset 38.000 seconds
10 >>
11 >> The system clock does not adjust.
12 >
13 >
14 > The hardware clock syncs to the software clock. If, when you run the date command, it prints the correct time (accounting for timezones) then as far as I know, that is the time your hardware clock uses. Besides, 38 seconds is not bad. Unless you are doing something between computers that requires EXTREMELY precise time, then I wouldn't bother. If you do want to fix things, ntpdate is kind of old (I assume that's what you meant, as I've never heard of htpdate). You can accomplish the same thing with the ntp command. Just use: ntpd -g -q. That will set the clock once according to the pool server, then quit. And it sets the clock, no matter how far off it is.
15
16 Yes, the "ntpd -g -q" work better; the time is adjusted correctly.
17
18 with /htpdate 1.ro.pool.ntp.org I always got the same Offset number, doesn't matter how many time I run it.