Re: [gentoo-user] setting system time
On 4/8/21 6:24 PM, Dan Egli wrote: > On 4/8/2021 6:07 PM, the...@sys-concept.com wrote: >> Try to set system clock via script: >> >> /usr/sbin/htpdate 1.ro.pool.ntp.org >> /sbin/hwclock -w >> >> But when I run it always prints: >> Offset 38.000 seconds >> >> The system clock does not adjust. > > > 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. Yes, the "ntpd -g -q" work better; the time is adjusted correctly. with /htpdate 1.ro.pool.ntp.org I always got the same Offset number, doesn't matter how many time I run it.
Re: [gentoo-user] setting system time
On 4/8/2021 6:07 PM, the...@sys-concept.com wrote: Try to set system clock via script: /usr/sbin/htpdate 1.ro.pool.ntp.org /sbin/hwclock -w But when I run it always prints: Offset 38.000 seconds The system clock does not adjust. 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.
[gentoo-user] setting system time
Try to set system clock via script: /usr/sbin/htpdate 1.ro.pool.ntp.org /sbin/hwclock -w But when I run it always prints: Offset 38.000 seconds The system clock does not adjust.
Re: [gentoo-user] setting the time
Daniel Waeber wrote: hi i have a problem with changing the time/date of my computer. I only can change it temporally till the next reboot. I tried date and ntptime to set it. after setting it the system shows the right time, but after a reboot i have the old time again. i have no other system running on the computer that could change the time, so it is a problem with linux/gentoo. do i somehow have to finalize the setting? thanks in advance ! Take a look in /etc/conf.d/clock: # If you want to set the Hardware Clock to the current System Time # during shutdown, then say yes here. CLOCK_SYSTOHC=yes -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] setting the time
Daniel Waeber wrote: (should i just write a mail to bug-coreutils@gnu.org, like the man page says?) Yes. Better still: include a patch with the proposed change. Benno -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] setting the time
In Linux you have the system clock and the hardware clock. The system clock is the clock of your motherboard that can be set in the bios setup. To set the system clock, the command is: date mmddhhmm To set the hardware clock, use the command: hwclock --set --date=mm/dd/ hh:mm:ss To set the system clock from the hw clock: hwclock --hctosys To set the hw clock from the system clock: hwclock --systohc Consult man date and man hwclock for more details. On 4/1/06, Jim [EMAIL PROTECTED] wrote: On Sun, 2006-04-02 at 03:20 +0200, Daniel Waeber wrote: hi i have a problem with changing the time/date of my computer. I only can change it temporally till the next reboot. I tried date and ntptime to set it. after setting it the system shows the right time, but after a reboot i have the old time again. i have no other system running on the computer that could change the time, so it is a problem with linux/gentoo. do i somehow have to finalize the setting? thanks in advance ! Edit /etc/conf.d/clock and set CLOCK_SYSTOHC to yes. This will sync your hardware clock to your system time when you shutdown/reboot. Jim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I'm a geek, but I don't get it. 36-24-36 = -24. What's the significance? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Florida, USA, Earth, Solar System, Milky Way -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] setting the time
Sorry... there is a mistake in my message. system clock is the clock of your motherboard should be hardware clock is the clock of your motherboard Sorry for the mistake. I hope I did not confused you. On 4/2/06, Technomancer [EMAIL PROTECTED] wrote: In Linux you have the system clock and the hardware clock. The system clock is the clock of your motherboard that can be set in the bios setup. To set the system clock, the command is: date mmddhhmm To set the hardware clock, use the command: hwclock --set --date=mm/dd/ hh:mm:ss To set the system clock from the hw clock: hwclock --hctosys To set the hw clock from the system clock: hwclock --systohc Consult man date and man hwclock for more details. On 4/1/06, Jim [EMAIL PROTECTED] wrote: On Sun, 2006-04-02 at 03:20 +0200, Daniel Waeber wrote: hi i have a problem with changing the time/date of my computer. I only can change it temporally till the next reboot. I tried date and ntptime to set it. after setting it the system shows the right time, but after a reboot i have the old time again. i have no other system running on the computer that could change the time, so it is a problem with linux/gentoo. do i somehow have to finalize the setting? thanks in advance ! Edit /etc/conf.d/clock and set CLOCK_SYSTOHC to yes. This will sync your hardware clock to your system time when you shutdown/reboot. Jim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I'm a geek, but I don't get it. 36-24-36 = -24. What's the significance? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Florida, USA, Earth, Solar System, Milky Way -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] setting the time
thank you for your help, everything is running perfect now :) it's easy if you know the difference between system and hwclock, but confusing if you only now about the date program. it would be nice if there would be a link to hwclock in the manpage of date, like it is the other way round. but this is not a gentoo specific problem i think. i'm new to linux so i don't know where to put my suggestion. (should i just write a mail to bug-coreutils@gnu.org, like the man page says?) -- gentoo-user@gentoo.org mailing list
[gentoo-user] setting the time
hi i have a problem with changing the time/date of my computer. I only can change it temporally till the next reboot. I tried date and ntptime to set it. after setting it the system shows the right time, but after a reboot i have the old time again. i have no other system running on the computer that could change the time, so it is a problem with linux/gentoo. do i somehow have to finalize the setting? thanks in advance ! -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] setting the time
On Sun, 2006-04-02 at 03:20 +0200, Daniel Waeber wrote: hi i have a problem with changing the time/date of my computer. I only can change it temporally till the next reboot. I tried date and ntptime to set it. after setting it the system shows the right time, but after a reboot i have the old time again. i have no other system running on the computer that could change the time, so it is a problem with linux/gentoo. do i somehow have to finalize the setting? thanks in advance ! Edit /etc/conf.d/clock and set CLOCK_SYSTOHC to yes. This will sync your hardware clock to your system time when you shutdown/reboot. Jim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I'm a geek, but I don't get it. 36-24-36 = -24. What's the significance? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Florida, USA, Earth, Solar System, Milky Way -- gentoo-user@gentoo.org mailing list