PDA

View Full Version : Linux time question



billyray520
11-16-2013, 01:52 PM
On my MVE desktop I have Ubuntu installed on the 2nd hdd. Whenever I boot into Ubuntu, everything works fine, including the time. BUT, when I boot back into Windows 7 after being in Ubuntu, my time is ALWAYS wrong and I have to reset it. (it's about 4 hrs. later or so.)

I figure that Ubuntu is saving the time in GMT in my BIOS, and converting it to my locale in the OS. Windows OTOH, seems to take my local time and save THAT to my BIOS. I like Windows idea better, since, even in BIOS it has the right time.

My question is: is there a way to work around this problem in Ubuntu Linux? E.g. can I set my locale differently, so it matches my Windows time?

Thanks experts! :D

Nodens
11-16-2013, 08:28 PM
Indeed. Linux uses UTC system clock by default so that changing timezones etc when travelling does not require changing the internal clock. Windows can be made to do the same thing.

So to make windows behave like Linux:

1. Open regedit and navigate to: HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInfo rmation
2. Make entry RealTimeIsUniversal DWORD and set value to 1

To make Linux behave like Windows:

Edit /e tc/default/rcS (forum editor doesn't like e tc so space inserted)

And add or change this:

UTC=no

billyray520
11-17-2013, 07:26 PM
Thanks Nodens! and props! :D That was just the thing I was needing. I don't move my desktop around, it just stays in one place, so turned off the UTC in Linux. Hopefully rcS will remain set even after updates... :eek: This makes booting into Linux much pleasanter, since I know it will leave the time alone.

Nodens
11-17-2013, 10:18 PM
I can't remember how it works with Debian distros but with Redhat ones when a customized file is being replaced by a package update it is not overwritten. Instead the new config file ends up as a .rpmnew and you have to manually inspect make any changes to your normal file. .deb should work similarly.:)

Nodens
11-17-2013, 10:21 PM
Hmr..no unfortunately Debian doesn't work that way:



If neither the user nor the package maintainer has changed the file, it is left alone. If one or the other has changed their version, then the changed version is preferred - i.e., if the user edits their file, but the package maintainer doesn't ship a different version, the user's changes will stay, silently, but if the maintainer ships a new version and the user hasn't edited it the new version will be installed (with an informative message). If both have changed their version the user is prompted about the problem and must resolve the differences themselves.


One more reason to like Redhat distros more :p

billyray520
11-18-2013, 02:23 PM
I'm not sure what package update would bother with rcS, but I did notice (after getting your answer) that Ubuntu recommends the exact same fix you suggested. I hope that is because it is likely a safe fix that won't be overwritten. :)

Nodens
11-18-2013, 05:04 PM
No there's a chance that it will be overwritten or that apt-get will ask you to resolve the conflict manually. There are so many variables in a conf file that safely merging via code is not really possible. As to what may change it? It's a astartup script, so any package that deals with that subsystem may pack a new version if it is required at some point.

billyray520
11-18-2013, 09:22 PM
I made a note of the change I made, so if it ever gets undone, it will be a simple matter to put right again. But thanks for the info Nodens. :)

Nodens
11-18-2013, 09:31 PM
No problem mate:)

Zygomorphic
11-18-2013, 11:33 PM
Hmr..no unfortunately Debian doesn't work that way:
One more reason to like Redhat distros more :p
Actually, that reasoning seems fair. If the user hasn't played with the config file, its updated automatically. If they have it respects that change and asks. How well they have implemented this feature, I'm not sure, the logic certainly seems OK to me. If users had to OK every single config file change, then that would cause a lot of annoyance whenever the maintainer updates a configuration file that users have no reason to edit.

Nodens
11-18-2013, 11:37 PM
Actually, that reasoning seems fair. If the user hasn't played with the config file, its updated automatically. If they have it respects that change and asks. How well they have implemented this feature, I'm not sure, the logic certainly seems OK to me. If users had to OK every single config file change, then that would cause a lot of annoyance whenever the maintainer updates a configuration file that users have no reason to edit.

But that's what happens as well with RPM. The difference is only one. Yum does not prompt you to resolve the config at that moment, it creates a .rpmnew. Debian apparently wants you to resolve it on the spot. That's the only difference. The other cases are handled in the same way.