LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Date and time settings after erroneously saying hardware clock was set to local time (https://www.linuxquestions.org/questions/slackware-14/date-and-time-settings-after-erroneously-saying-hardware-clock-was-set-to-local-time-4175634852/)

fusion809 07-25-2018 12:27 AM

Date and time settings after erroneously saying hardware clock was set to local time
 
Hi,

During the Slackware set up process I chose the option that my hardware clock was set to local time, as I was unsure as to whether hardware clock was set to local or UTC time. Running `date` in a TTY terminal while in the Slackware live session returned the UTC time, so I'm now suspecting the hardware clock was actually set to UTC time. How do I undo this unwise decision of mine to say it was set to local time, when it was probably UTC time?

Presently my Slackware install is reporting the time in my timezone to be 5:30 AM 25 July 2018, when it's 3:30 pm 25 July 2018. I looked at the date and time setting of my KDE system and it said it was set to my local time (AEST, Australia/Brisbane). This is another reason why I suspect my selection in the setup program was erroneous.

Thanks for your time,
Brenton

ponce 07-25-2018 12:38 AM

just run (as root)
Code:

timeconfig

fusion809 07-25-2018 01:37 AM

Thanks, I just followed your advice, but unfortunately everything is still returning the erroneous time. So I'm guessing a reboot is required, which I will do now.

fusion809 07-25-2018 01:43 AM

OK then, I'm afraid the problem is persisting despite the reboot. If I run `date` I get:

Code:

Wed Jul 25 06:41:42 AEST 2018
when it should return:

Code:

Wed Jul 25 16:41:42 AEST 2018
as that is the correct time. Any ideas what I need to do? If it is relevant I do have rc.ntpd running on boot.

ponce 07-25-2018 01:54 AM

maybe it's a misconfiguration of ntpd that is causing that.

if you do an
Code:

/etc/rc.d/rc.ntpd stop
and you run (still as root)
Code:

sntp -s pool.ntp.org
hwclock -w

what does the date command outputs after that?

fusion809 07-25-2018 01:56 AM

Made no difference, I'm afraid, still reporting it's almost 7 AM.

ponce 07-25-2018 02:01 AM

Quote:

Originally Posted by fusion809 (Post 5883381)
Made no difference, I'm afraid, still reporting it's almost 7 AM.

are you sure you stopped ntpd before doing that?

what does the commands
Code:

ls -la /var/log/packages/glibc-zoneinfo*
zdump /etc/localtime

say?

fusion809 07-25-2018 02:06 AM

I didn't stop it, as I didn't know I was meant to (I think you added that ntpd stopping command to your previous comment after I had originally read it and acted on its original instructions), but I just did and repeated your previous command (the sntp one) and the same result occurred. Your latest command returns:

Code:

-rw-r--r-- 1 root root 71376 Jul 25  2018 /var/log/packages/glibc-zoneinfo-2018e-noarch-2_slack14.2
/etc/localtime  Wed Jul 25 07:02:30 2018 AEST

.

ponce 07-25-2018 02:11 AM

when you have stopped ntpd, can you please post also the output of
Code:

sntp -s pool.ntp.org

fusion809 07-25-2018 02:13 AM

Here is the output:

Code:

sntp 4.2.8p11@1.3728-o Wed Feb 28 23:47:11 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
2018-07-25 07:12:38.600972 (-1000) +36000.243656 +/- 24000.195345 pool.ntp.org 203.122.222.157 s2 no-leap
adj_systime: Invalid argument


ponce 07-25-2018 02:50 AM

when you run timeconfig the second time, at the beginning of the topic, you have set your clock to localtime and not UTC, right?
this unfortunately is my last guess.

ponce 07-25-2018 02:58 AM

Quote:

Originally Posted by fusion809 (Post 5883392)
Code:

sntp 4.2.8p11@1.3728-o Wed Feb 28 23:47:11 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
2018-07-25 07:12:38.600972 (-1000) +36000.243656 +/- 24000.195345 pool.ntp.org 203.122.222.157 s2 no-leap
adj_systime: Invalid argument


well, I actually have another last one, based on the last line of that output: try also to use sntp with the -S option
Code:

sntp -S pool.ntp.org
and post the output.

fusion809 07-25-2018 03:03 AM

Due to the problem I thought I had to set it to UTC, as localtime was the setting when I first noticed this problem.

Your sntp command returns:

Code:

sntp 4.2.8p11@1.3728-o Wed Feb 28 23:47:11 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
2018-07-25 08:01:22.762445 (-1000) +36000.274741 +/- 24000.224313 pool.ntp.org 103.214.220.220 s2 no-leap

with the UTC hardware clock setting, however, I get:

Code:

sntp 4.2.8p11@1.3728-o Wed Feb 28 23:47:11 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
2018-07-25 18:02:15.690005 (-1000) -0.001783 +/- 0.002531 pool.ntp.org 27.124.125.252 s3 no-leap

(which seems the same). Aha! Running:

Code:

sntp -s pool.ntp.org
hwclock -w

with localtime as the hardware clock setting, has fixed the problem, thanks!

ponce 07-25-2018 03:17 AM

Quote:

Originally Posted by fusion809 (Post 5883410)
Due to the problem I thought I had to set it to UTC, as localtime was the setting when I first noticed this problem.

that confused me, because in the first post I thought you said that you wanted to do the opposite. :)
Quote:

Originally Posted by fusion809 (Post 5883354)
Hi,

During the Slackware set up process I chose the option that my hardware clock was set to local time, as I was unsure as to whether hardware clock was set to local or UTC time. Running `date` in a TTY terminal while in the Slackware live session returned the UTC time, so I'm now suspecting the hardware clock was actually set to UTC time. How do I undo this unwise decision of mine to say it was set to local time, when it was probably UTC time?

Presently my Slackware install is reporting the time in my timezone to be 5:30 AM 25 July 2018, when it's 3:30 pm 25 July 2018. I looked at the date and time setting of my KDE system and it said it was set to my local time (AEST, Australia/Brisbane). This is another reason why I suspect my selection in the setup program was erroneous.

Thanks for your time,
Brenton

please mark the thread as solved.


All times are GMT -5. The time now is 09:11 AM.