Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Last active January 27, 2023 09:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinewalker/644ddc538434aa95d6e586ba0f28c94a to your computer and use it in GitHub Desktop.
Save sinewalker/644ddc538434aa95d6e586ba0f28c94a to your computer and use it in GitHub Desktop.
Make Windows 7+ use UTC Real-time-clock
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
@sinewalker
Copy link
Author

sinewalker commented Dec 17, 2017

This is preferred if you have a dual-boot system that runs Windows as the alternate OS. Otherwise your RTC will get reset to the wrong time when Windows runs (and Windows will have the wrong idea of the time too, because it assumes RTC is local when it boots).

You also need to turn off the Windows Time Service (which writes to the RTC in local time despite the above registry setting), with this command from a prompt:

sc config w32time start= disabled

@sinewalker
Copy link
Author

sinewalker commented Dec 17, 2017

To revert:

  • set "RealTimeIsUniversal=- (minus) in the registry file and re-import it
  • sc config w32time start= demand

@sinewalker
Copy link
Author

sinewalker commented Dec 17, 2017

In Linux (systemd), you can also set/disable local time in the RTC. Perhaps you want to leave Windows alone and tweak Linux instead? But UTC is recommended if you can:

sudo timedatectl set-local-rtc 1 (enables. 0 disables).

@sinewalker
Copy link
Author

After doing one of these, reboot, and make sure that the RTC is set correctly from the BIOS/UEFI firmware

@SamSirry
Copy link

SamSirry commented Apr 8, 2022

Here's a command prompt one-liner for the same effect:
reg add HKLM\System\CurrentControlSet\Control\TimeZoneInformation /t REG_DWORD /v RealTimeIsUniversal /d 1

@ross-dobson
Copy link

Just a note that you cannot run sc config w32time within a Powershell prompt, it needs to be the true Command Prompt. Alternatively, you can use Invoke-Command to run sc.exe within Powershell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment