Day 43 - MISSED; Clock issues on Windows-Ubuntu Dual Boot

Ah, this is going to be my sixth MISSED post. The irony of it all is that yesterday, I really had a topic to write about. A topic that a friend asked me about earlier in the day and one that I have faced many times myself. Uh, irony.

Managing your Clock on Windows-Ubuntu Dual Boot

Switching over to Windows and seeing the wrong time or switching to Ubuntu and seeing the wrong time, it’s all pretty irritating. It keeps happening, there’s no easy way to fix that, this is my recipe. It’s pretty easy, I think.

  1. Turn off the Update time from Internet option on all your operating systems
  2. Boot into Windows, and open the registry editor. (WinKey + R followed by regedit in the text box)
  3. Edit this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  4. Right-click in the right-side panel and select New > DWORD Value. Create the key named RealTimeIsUniversal and give it a value of 1.
  5. Now, restart your computer and boot into Ubuntu. We will set the Hardware clock to UTC time.
  6. Open a terminal, you need root privileges on your machine
  7. Let’s start with the basics. Run sudo hwclock --show, this should show you the current time that’s stored in your hardware clock
  8. Set this to the current UTC which should be available to you through your phone or the Internet. (Read further to see how to do this from a great GUI)
    1. hwclock supports the GREAT feature of copying over time from the system
    2. So, open the calendar / date-time GUI application and set the proper time there.
    3. Make sure automatic updation of the time from the internet is turned off
    4. Once you have set the proper time for your timezone in the window, you can run sudo hwclock --systohc. This will copy over the current system time to the hardware clock.
    5. You should also probably run sudo hwclock --utc to make sure that the hardware clock is kept in UTC
  9. Open the file /etc/default/rcS and UTC=yes to that file
  10. You are SET now!

This guide serves as an enhancement to the two pages that I have in my bookmarks bar under the folder Clock issues (Yeah, right, that’s how big a problem this was)

Windows-Linux Dual Boot System Issues on mikebeach.org

Examples of using hwclock on thegeekstuff.com

That’s the end of my tutorial for the most part, a couple of quick points about this setup.

The main problem here is that Linux interprets the Hardware clock to be set in UTC whereas Windows assumes it to be in Local time by default, this creates the initial inconsistency.

Automatica time updation from the internet probably changes the hardware clock right after startup and right before shutdown instead of changing it once? I don’t know anything about this, but I have a feeling that this also works differently in both operating systems. Simply turning it off and adjusting for the drift of the hardware clock every year or something as infrequent as that will ensure that the setup is simple! (This also enables freely changing the timezone on whichever operating system, that should not affect the hardware clock at all)

POST #43 is OVER