LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-28-2019, 06:12 PM   #16
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896

As posted the actual hardware clock time and the reference setting must be the same. If the BIOS clock is set to UTC then the setting in /etc/adjtime is UTC.

The system clock and ntp are based on UTC as a reference. On shut down the system sets the hardware clock as based on the hardware clock configuration setting. If the clock is set to UTC then your system is independent of timezone settings and DST.

Last edited by michaelk; 10-28-2019 at 06:14 PM.
 
Old 10-28-2019, 06:29 PM   #17
dalacor
Member
 
Registered: Feb 2019
Distribution: Slackware
Posts: 170

Original Poster
Rep: Reputation: Disabled
To Frankbell, that is a very good reference thank you. I see that it means that the operating system specifically is based on local or UTC not the type of machine itself which is what I had thought from what another poster said. But it's Windows and the Mac OS that use local and UTC respectively not the fact that its a pc or mac machine per se.

To Michaelk, it's probably because I have always set the Bios to local time and Slackware to UTC that this happened or maybe I was dual booting at the time or perhaps I had set the time to the correct time manually then rebooted the pc and saw that it changed the time.

From reading that article that Frankbell linked to, I am wondering if I should be using UTC not local time because otherwise I am not sure how the logs handle time when the clocks go back an hour although most of the times that I would be interested in within the logs, would not be 1am/2am when the clocks change. It would always be working hours. Maybe I will just set it as local time as it's easier to set the time in bios based on my watch without worrying whether I am in DST or not. As the computer never restarts or shuts down, the hardware clock is not so relevant. I need the software clock to get the correct time for daylight savings which obviously it won't get from the bios if the computer never reboots
 
Old 10-28-2019, 06:53 PM   #18
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,504

Rep: Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461
Quote:
Originally Posted by dalacor View Post
As the computer never restarts or shuts down, the hardware clock is not so relevant. I need the software clock to get the correct time for daylight savings which obviously it won't get from the bios if the computer never reboots
Seems like more reason to use UTC for the hardware time. See, the system time will change automatically for a daylight saving change regardless of whether the hardware clock is storing UTC or local time. The difference is that when the machine boots it'll take the system time directly from the hardware clock if it's local time, or it will calculate the offset based on the tzdata tables and the current date if it's stored as UTC. But the system time is only saved to hardware on a reboot. So let's say you're using local time in hardware and a time change has occurred since the last boot. Since you don't reboot the machine, that change is never saved back to hardware. Then if you get a power failure, when the machine reboots you'll be off by an hour. That's one of the benefits of using UTC for hardware time - that time will never need to be adjusted/saved when a time change happens, and it won't matter whether the machine is powered on or not when the change happens.

As others have noted, dual booting with Windows can complicate things. But, since you're not doing that it won't be an issue. Using UTC should be the most reliable way to store time, and adding NTP on top of that will keep things accurate.
 
5 members found this post helpful.
Old 10-28-2019, 07:02 PM   #19
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
Windows (7-10) is a easy fix:

Regedit:
Code:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation
add DWORD: RealTimeIsUniversal and set to 1

I have a computer set like this.

Last edited by Skaendo; 10-28-2019 at 07:04 PM.
 
Old 10-28-2019, 07:33 PM   #20
dalacor
Member
 
Registered: Feb 2019
Distribution: Slackware
Posts: 170

Original Poster
Rep: Reputation: Disabled
To Skaendo - I am not using these machines for Windows. So won't need to worry about editing the registry thank you. But useful to know.

To Volkerdi. Thank you for your input. I have always set the boxes to UTC time, but for some reason I have noticed the time was wrong in the logs (by an hour) for part of the year. I will follow your suggestion of setting the Bios to the GMT Time which I understand is the same thing as UTC time and use NTP to ensure the time is accurate to prevent time drift as even just a few minutes makes it difficult to troubleshoot in logs.

Your explanation of the problems caused by a power cut and the Bios using local time makes sense and your point that it makes no difference to slackware whether the system is using UTC or not - DST is unaffected. So it does actually make sense to set both the bios and Slackware to use UTC, then configure Slackware to use NTP for time drift.

Then if I ever see the hour off issue in the logs somewhere I can investigate to see whether this is specific to one program installed or why this is occurring. Better yet, the EU and the UK could permanently stop changing the clocks twice a year which is something the EU are considering and would solve a lot of problems!

Thank you
 
Old 10-28-2019, 08:18 PM   #21
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Slightly off topic... Time can be quite complicated. Yes UTC and GMT share the same current time but they are not the same thing. UTC is a time standard and GMT is a timezone. Coordinated Universal Time (UTC) is the standard by which all time zones are based and all time is synchronized.

In addition the UK has a time standard radio station (NPL).
https://en.wikipedia.org/wiki/Time_from_NPL_(MSF)

https://en.wikipedia.org/wiki/Coordi...Universal_Time

Last edited by michaelk; 10-28-2019 at 08:29 PM.
 
Old 10-29-2019, 07:37 PM   #22
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I'm using several distros with UTC, NTP, and my local time set by timezone.

In my systems, the DST adjustment seems to happen automatically. At least, I don't remember having to adjust for DST.

I found an article that might help: https://www.galsys.co.uk/news/just-n...e-changeovers/
 
  


Reply



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
[SOLVED] Centos7, invalid offset for UTC for Sweden, says UTC+00 Basher52 CentOS 14 02-09-2018 10:10 PM
[SOLVED] Setting up timezones, should I use GMT/UTC? slacker_ Linux - Newbie 6 09-01-2013 02:58 AM
Timezone in reverse. GMT+4 works as GMT-4 Lockywolf Slackware 3 05-20-2012 05:25 PM
Clock on wrong time (system clock is set to UTC) yanom Debian 6 07-26-2011 11:26 AM
Is the Linux GMT/UTC definition inverted? jjinno Linux - Software 11 01-05-2010 07:15 PM

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

All times are GMT -5. The time now is 09:54 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
Open Source Consulting | Domain Registration