Clock messed up when dual booting

The problem:

  • Linux store the time on the hardware clock as UTC by default
  • Windows store the time on the hardware clock as the local time by default

Since both operating systems access the hardware clock you may encounter problems when you dual boot between them.

A comment for the geeks:

The advantage of having the hardware clock as UTC is that you don’t need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets.

Changing Windows to use UTC

If you dual boot Windows and Linux/MAC and the clock is messed up after each boot, you should either :

  1. run regedit
  2. navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  3. add key RealTimeIsUniversal as DWORD and set it’s value to 1.
  4. disable Windows time service:
sc config w32time start= disabled

You can download a REG script that performs the first 3 steps from here but you will have to perform the last step (disable the service) manually.

Changing Linux to use local time

Pre-Ubuntu 15.04 systems (e.g. Ubuntu 14.04 LTS):

  1. edit /etc/default/rcS
  2. add or change the following section
# Set UTC=yes if your hardware clock is set to UTC (GMT) UTC=no

Ubuntu 15.04 systems and above (e.g. Ubuntu 16.04 LTS):

  1. open a terminal and execute the following command
timedatectl set-local-rtc 1

References:

2 thoughts on “Clock messed up when dual booting”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s