LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-25-2018, 12:27 AM   #1
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Rep: Reputation: Disabled
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
 
Old 07-25-2018, 12:38 AM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
just run (as root)
Code:
timeconfig
 
Old 07-25-2018, 01:37 AM   #3
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Original Poster
Rep: Reputation: Disabled
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.
 
Old 07-25-2018, 01:43 AM   #4
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Original Poster
Rep: Reputation: Disabled
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.
 
Old 07-25-2018, 01:54 AM   #5
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
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?

Last edited by ponce; 07-25-2018 at 01:56 AM.
 
Old 07-25-2018, 01:56 AM   #6
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Original Poster
Rep: Reputation: Disabled
Made no difference, I'm afraid, still reporting it's almost 7 AM.
 
Old 07-25-2018, 02:01 AM   #7
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
Quote:
Originally Posted by fusion809 View Post
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?
 
Old 07-25-2018, 02:06 AM   #8
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Original Poster
Rep: Reputation: Disabled
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
.
 
Old 07-25-2018, 02:11 AM   #9
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
when you have stopped ntpd, can you please post also the output of
Code:
sntp -s pool.ntp.org
 
Old 07-25-2018, 02:13 AM   #10
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Original Poster
Rep: Reputation: Disabled
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

Last edited by fusion809; 07-25-2018 at 02:19 AM.
 
Old 07-25-2018, 02:50 AM   #11
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
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.
 
Old 07-25-2018, 02:58 AM   #12
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
Quote:
Originally Posted by fusion809 View Post
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.

Last edited by ponce; 07-25-2018 at 03:00 AM.
 
Old 07-25-2018, 03:03 AM   #13
fusion809
LQ Newbie
 
Registered: Feb 2016
Location: Australia
Distribution: Several; Tumbleweed is presently my primary OS.
Posts: 11

Original Poster
Rep: Reputation: Disabled
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!
 
Old 07-25-2018, 03:17 AM   #14
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,699

Rep: Reputation: Disabled
Quote:
Originally Posted by fusion809 View Post
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 View Post
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.

Last edited by ponce; 07-25-2018 at 03:18 AM.
 
  


Reply

Tags
datetime, setup


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hardware clock time differs from system time after setting maxgsp Linux - Hardware 1 02-27-2009 05:24 AM
Date, clock and time zone settings varun_saa Mandriva 2 05-05-2008 07:10 AM
Trying to set system's clock to local time; where is tzconfig gone? Hungry ghost Debian 5 11-18-2007 09:45 PM
Should I set system clock to GMT or local time? square_eyes Linux - General 4 01-22-2007 03:59 PM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration