[SOLVED] I have never understood what the hardware clock (UTC/GMT) setting means
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.