Fixing incorrect clock / time settings while dual-booting Windows/Linux - gHacks Tech News

Fixing incorrect clock / time settings while dual-booting Windows/Linux

So, I recently got my father to start to switch from Windows to GNU/Linux. The man is a serious privacy freak who knows Windows systems better than almost anyone who hasn't been formally trained.

Envision a hermit with long hair and a bushy beard who has spent years complaining about the state of privacy, governments and the like; you aren't far from the truth with that image.

In the light of Windows 10 becoming the main OS for Windows users, and Windows 7 users being pushed harder and harder to switch, he has been growing more and more curious about making the switch. He's currently dual-booting and isn't quite ready to make a total conversion yet, but he's getting there!

With that being said, an issue that he is facing, and that I know many others have faced when running a dual-boot system, is when they swap over to GNU/Linux for a while, and then boot back into Windows only to find that their clock is set at the wrong time!

The reason for this is because GNU/Linux (as well as other OS's like Mac OS X) use UTC (Coordinated Universal Time) and Windows does not. Because the two operating systems communicate with your hardware and system a little differently on this topic, there is always going to be that little bit of an issue....or is there?

The GNU/Linux Solution

Linux Time

The solution, or rather, multiple possible solutions, are all quite easily solved. My preferred method for this issue, is simply to make the GNU/Linux system use 'localtime' instead of UTC. To do this on any modern system using SystemD, use the following command:

sudo timedatectl set-local-rtc 1

And done. That was easy!

The Windows Solution

However, for those of you who are curious about what the Windows based solution would be, we need to create a .reg registry file. Open Notepad, and paste this into it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001

Next, save that file as "WindowsTimeFix.reg" and exit Notepad. Then, navigate your file browser to wherever you saved the file we just made, and double click it. A box will pop up essentially asking if you want to proceed, tell it that you do.

Once that is done, you'll also want to disable Windows syncing the time. To do this, you'll want to go to your services application by clicking your start menu and typing "services.msc", and clicking "Services." Once there, scroll down until you find "Windows Time" and right click it, selecting "Properties." From here, you'll want to stop the process, and then disable it as well.

Or, run the command sc config w32time start= disabled from an elevated command prompt instead. To turn the Windows Time service back on at a later point in time, run the command sc config w32time start= auto instead.

Once Windows Time has been stopped and disabled and the registry key has been changed, your Windows will no longer have the time issue whenever you switch back and forth between GNU/Linux.

Note: There is no need to do both of these things, doing so would actually KEEP the problem alive. Please pick whichever solution you feel like doing, and do that one. Do not do both! That's it! Happy computing!

Summary
Article Name
Fixing incorrect clock / time settings while dual-booting Windows/Linux
Description
Find out how to fix incorrect clock and/or time settings when you you work on dual boot systems running Windows and Linux.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:


Previous Post: «
Next Post: »

Comments

  1. Thiago said on July 30, 2017 at 7:57 am
    Reply

    Off topic.

    I use the Neustar Free Recursiv DNS (https://www.neustar.biz/security/dns-services/free-recursive-dns-service) with option Threat Protection (ipv4 156.154.70.2 and 156.154.71.2 – ipv6 2610:a1:1018::3 and 2610:a1:1019::3. Your filter blocked ghacks how hacking. If possible (admin of ghacks) contact Neustar to solved problem.

    1. Nebulus said on July 30, 2017 at 1:49 pm
      Reply

      Thiago, you should switch to a more reliable DNS service… Though, I have a hard time letting a third party choose what they think is best or secure for me.

      1. Thiago said on July 30, 2017 at 10:13 pm
        Reply

        Neustar Free Recursive DNS is secure. Consider that others users use too. The best solution not is flee, but solve problem. It is only 1 false positive.

    2. Jed said on July 30, 2017 at 6:12 pm
      Reply

      Personally I recommend OpenDNS, their DNS servers have yet to cause any issues.

      1. Thiago said on July 30, 2017 at 10:15 pm
        Reply

        It is only 1 false positive. Normal.

      2. Thiago said on July 31, 2017 at 8:22 am
        Reply

        Note: Exist Neustar Free Recursive DNS without filter. The Neustar use 30 nodes and OpenDNS only 25.

    3. mikef90000 said on August 3, 2017 at 1:35 am
      Reply

      It doesn’t look like Neustar offers a dnscrypt server like OpenDNS does. Therefore not an option for me.

  2. Bean said on July 30, 2017 at 8:51 am
    Reply

    Hey! I’ve had this problem too, and I used this little program from Net Time: http://www.timesynctool.com/
    In linux, the time stays fine, but in windows it was bouncing around. This small service keeps everything updated for me.
    May not be as elegant as your solution, but I find it’s maintenance free, and the file/service is 771kb/465kb respectively.

  3. Anonymous said on July 30, 2017 at 10:18 am
    Reply

    Had several problems with windows updates after trying the registry hack, best to make the change in linux.

    1. Anonymous said on July 31, 2017 at 11:12 am
      Reply

      That was 6 or 8 months ago however so maybe microsoft changed something in there.

  4. Corky said on July 30, 2017 at 11:02 am
    Reply

    You’d think at some point in the preceding 35 years that Microsoft would’ve corrected the original mistake of using RTC but apparently not, having leftovers from the days of MSDOS says a lot IMO.

    1. David B. said on July 31, 2017 at 4:35 pm
      Reply

      They can’t; there are actually programs out there (almost certainly from pre WinXP days; yes, I mean Win3.1, 95, 98, etc) that are designed to work around this issue, and fixing it would cause them to break.

      That’s a drawback to being the 800lb gorilla in the market; even when they *want* to fix it, they probably *can’t*.

      Heh.

  5. Robert G. said on July 30, 2017 at 12:11 pm
    Reply

    Like Bean, I use NetTime 3.1.4.220 in Windows, it’s precise.

  6. Rocky said on July 30, 2017 at 12:39 pm
    Reply

    Good write up . This problem caused issues for me when I first started dual-booting.

    Slightly offtopic but the similarities between Windows registry and system D commands are interesting.

  7. jupe said on July 30, 2017 at 1:48 pm
    Reply

    Slightly off topic but I have a problem with my Javascript time in Firefox being incorrect, if I go to this page for example https://browserleaks.com/javascript It reports the time wrong under System Time: at the end of that line it says GMT+0000 (UTC) whereas if I view it in IE or Edge (the only other browsers I have installed) it says GMT+1000 (AUS Eastern Standard Time) at the end of that line giving the correct time, its a pain because it makes times for forum posts etc wrong. Anyone have a solution for this ?

  8. Mark Hazard said on July 30, 2017 at 3:29 pm
    Reply

    Thanks for the article. It was enlightening.

  9. jern said on July 30, 2017 at 6:21 pm
    Reply

    I have the same problem on a Mac with Win7 running under Bootcamp. I’ll try the Win registry solution and see what happens.

    1. jern said on July 30, 2017 at 7:52 pm
      Reply

      It works to coordinate Windows-on-a-Mac time as well. In the Win7 registry I created the new RealTimeIsUniversal Dword key, entered the value and checked that Windows Time was disabled.

      I can enter a new time in either Windows or MacOSX and it coordinates with the other OS. Nice tip!

      1. Mike Turcotte said on July 30, 2017 at 10:37 pm
        Reply

        Glad it helped!

  10. dmacleo said on July 30, 2017 at 6:36 pm
    Reply

    I dual boot mint and win10 and both use system bios for time, never issue.

  11. Anonymous said on July 30, 2017 at 6:53 pm
    Reply

    Simply set the clock in Linux to local time in clock settings…no reason to have to resort to the command line. Also an ad-blocker, script blocker and Privacy Badger are a necessity in the web browser of choice in either OS.

  12. Jukka said on July 30, 2017 at 7:55 pm
    Reply

    Not certain about this but I’ve read that you may need to use QWORD instead of a DWORD registry entry in a 64bit Windows 10.

  13. Bengt Frost said on July 30, 2017 at 8:46 pm
    Reply

    Great, Thank You!

  14. IPonymous said on July 30, 2017 at 9:19 pm
    Reply

    Which part of:

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
    “RealTimeIsUniversal”=dword:00000001

    Do I copy and paste,… All of it? Maybe somehow highlighting the actual copy and paste part. SInce i’m a typical Windows user i’m always overly cautious making changes to registry because I cant foresee what could go wrong nor how to fix it. An error might make it “Explode!” Lol

    1. Martin Brinkmann said on July 30, 2017 at 9:50 pm
      Reply

      You copy the whole thing. If you feel uncomfortable doing so, open the Registry Editor manually instead and navigate to the path to add the Dword manually.

  15. basicuser said on July 30, 2017 at 10:06 pm
    Reply

    Hello,

    After many years of following developments at the always informative and often lively discussions at ghacks I finally have a question.

    To learn a bit about Linux I am running Linux Mint 17.1 cinnamon 64bit on a USB3 thumb drive with persistance enabled using Yumi multiboot USB creator. This is plugged into a W7 Pro box. I can connect to the net and have d-loaded a few things from the linux repositories so that seems to work.

    I have the same issue of Mint time being off rather than USA -5 hours, which I manually set each time I open Mint. However the setting won’t stick. It does remember the east coast zone part, but the time is always 4 hours late when opening Mint. (Say 3PM local v 11AM “linux” time)

    I’ve tried to follow Mike’s directions to use local time using Systemd by right clicking the systemd folder and opening in terminal. There I type in “sudo timedatectl set-local-rtc 1” (without quotes) and hit enter but that just jumps down one line waiting for more instructions, and it won’t stick. So far closing Mint has not changed the computer’s time.

    What am I doing wrong?

    Thanks for any help.

    1. Mike Turcotte said on July 30, 2017 at 10:36 pm
      Reply

      basicuser,

      https://forums.linuxmint.com/viewtopic.php?t=226779

      According to this, on earlier versions of Linux Mint (Pre-Mint 18) you need to edit /etc/default/rcS

      Check out post #2 on that thread and see if that helps you :)

      1. basicuser said on July 30, 2017 at 11:32 pm
        Reply

        Thanks. Thanks to your link, found my way to the file I need to edit. I’ll try that as soon as I figure out how to get elevated rights to be able to edit the rcS file permissions.

      2. Mike Turcotte said on July 31, 2017 at 12:15 am
        Reply

        sudo nano /etc/default/rcS

        or sudo gedit /etc/default/rcS
        or sudo kate /etc/default/rcS

        or sudo INSERTYOURFAVOURITEtexteditorHERE /etc/default/rcS

        etc etc

      3. basicuser said on July 31, 2017 at 12:36 am
        Reply

        Mike,

        Thank you for your time and knowledge.

        “sudo gedit /etc/default/rcS” did the trick.

        From the little I found on line there’s a lot of opinions but not much agreement on elevated rights.

        Shut down Mint, rebooted and local time stuck. Lesson learned.

      4. Mike Turcotte said on July 31, 2017 at 12:43 am
        Reply

        basicuser,

        sudo is the command you use for just about everything that required elevated privileges :)

        There is an article about sudo being posted in the near future, so stay tuned!

        The simplified version is:

        sudo = super user do.

        anytime you need elevated privileges, preface your command with sudo.

        gedit is just a text editor.

        The command you used basically said “Open this file in the gedit text editor, with root”

        hope that helps explain it a little more!

      5. basicuser said on July 31, 2017 at 1:47 pm
        Reply

        OK, will be watching for the article. With the sudo command I’ll be able to get into a lot of trouble poking around Linux. :)

  16. hirobo2 said on July 31, 2017 at 1:15 am
    Reply

    It really sucks on my 2-in-1 tablet. Every time I switch to Android back to Windows, the time is changed.

  17. Moana said on July 31, 2017 at 2:46 am
    Reply

    Thankyou for this! Immense! Just for kicks im a hackintosh (main productivity) / windows 7 (games console) configuration.

    Just in case for all you linux users there, if you have the right hardware, getting a hackintosh up and running is as simple as installing the os and running -one- application for all the drivers. The apple services (including the store) all work except for imessage so if you ever get mac hardware its seamless. There’s a full ecosystem of high quality apps, it took a good year to explore but i’m short of nothing coming from windows. It also plays games. Admitted its been a decade since i’ve used either kde or gnome but the windows environment doesn’t feel flaky.. the main bonus.

    1. Mike Turcotte said on July 31, 2017 at 6:44 am
      Reply

      Hackintosh is very choosy about hardware though. For example, Intel Wifi Adapters are a no go. Neither is Nvidia+Intel Optimus, so as you said, if you have the right hardware…Which isn’t as broad as one could wish.

      Anyway, glad you enjoyed the article!

      1. Moana said on August 1, 2017 at 7:07 am
        Reply

        Hey thanks for writing the article!

        To your point, having the right hardware makes a difference (goes from the easiest os install you have ever done for any os to impossible weekends of screwing around).. but, the hardware it does support does not have to be expensive unlike the genuine custom stuff.

        Eg, for a wifi adaptor its not worth your time finding drivers, but a $15US tp-link one works great.. same for graphics.. im sure the cheapest nivida card on the market will do fine.

        In my experience the budget componets have a higher chance of working due to the lack of / generic chips included.

        Good luck! The osx ecosystem is worth it ;)

  18. Roland said on July 31, 2017 at 3:39 pm
    Reply

    Setting any computer to localtime makes no sense. Computers (mostly laptops) move across timezone boundaries. And real (ie linux/unix) computers can have multiple users at once, and they can be remote. The smart way is to keep the hwclock (not the OS) in UTC and don’t adjust it (let ntpd do that). Travelers can run tzselect to change their individual TZ shell variable. The concept of localtime is nuts (Nepal, India, Newfoundland), as is its history.
    https://en.wikipedia.org/wiki/Time_zone
    Nobody can keep track of it, but software can, and is updated. Works under linux, MS is not only broken, they don’t even try.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.