Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Dual boot system Windows XP Pro and Ubuntu 12.04.

I have the bios set for the correct time and Ubuntu set for US Eastern time. Ubuntu will boot up and the time will be off by -4 hours. If I correct the time in Ubuntu then when I boot up in Windows XP the time will be off by + 4 hours.

This is a fresh install of 12.04. I did not have this problem before reinstalling Ubuntu.

share|improve this question

Multiple Boot Systems Time Conflicts

Operating systems store and retrieve the time in the hardware clock located on your motherboard so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably Microsoft Windows) store the time on the hardware clock as the 'local' time. This causes problems in a dual boot system if both systems view the hardware clock differently.

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 Linux to use local time is easier and more reliable than changing Windows to use UTC, so dual-boot Linux/Windows systems tend to use local time.

Since Intrepid (8.10), UTC=yes is default.

Make Windows use UTC

Note: This method was not initially supported on Windows Vista and Server 2008, but came back with Vista SP2, Windows 7, Server 2008 R2 and Windows 8/8.1.

To make MS Windows calculate the time from the hardware clock as UTC.

Create a file named WindowsTimeFixUTC.reg with the following contents and then double click on it to merge the contents with the registry:

Windows Registry Editor Version 5.00

Note: Windows Time service will still write local time to the RTC regardless of the registry setting above on shutdown, so it is handy to disable Windows Time service with this command (if time sync is still required while in Windows use any third-party time sync solution):

sc config w32time start= disabled

Reversing the change
You can create a file with the following contents and then double-click it to merge in the original changes, as above:

Windows Registry Editor Version 5.00

If Windows Time service was disabled, enable it again with the command:

sc config w32time start= demand

Make Linux use 'Local' time

To tell your Ubuntu system that the hardware clock is set to 'local' time:

  1. edit /etc/default/rcS
  2. add or change the following section

    # Set UTC=yes if your hardware clock is set to UTC (GMT)
share|improve this answer
But I already have UTC=no in my /etc/default/rcS. I have UTC=no and have the problem. – Green Aug 2 '13 at 5:34
Note how awkward it is to fix it in Windows and how comparatively straightforward it is to fix it in Linux... :) – Lagerbaer Oct 29 '13 at 16:15
Oh lord. I can't believe they were dumb enough to use local time on a hardware clock. Why would you ever, ever do that? – iono Dec 9 '13 at 7:22
@twome because since there wasn't much in the way of networking in the early days of MS-DOS, and it wouldn't have been common to move a PC so far that it moved timezones. (And yeah, even considering that history, it was still not the best move). – Jon Hanna Apr 22 '14 at 13:44
@Laqerbaer, changing a registry setting is as trivial for a Windows user as changing a config file is for a Linux user. So spare us the petty sniping. – Alan B May 22 '14 at 18:58

Your time zone is Eastern, which is currently EDT (Eastern Daylight Time). EDT is UTC minus four hours, the same as the offset you're experiencing.

When this happens on a dual-boot system, it's usually because one operating system thinks the hardware clock tracks local time, while the other operating system thinks the hardware clock tracks UTC.

In your case, your hardware clock is probably set to the local time, and:

  • Windows is set to use local time, which (given your time settings) is correct.
  • Ubuntu is set to use UTC, which (given your time settings) is incorrect.

If you were to just reset the time in the Ubuntu system, either manually or automatically, it would then be wrong in Windows, so that's not a good solution.

Instead, the best solution is probably to reconfigure Ubuntu to treat the hardware clock time as local time (then you can leave your Windows configuration, and your hardware clock time, alone).

To do this, edit /etc/default/rcS as root and make sure it has UTC=no:

  1. Press Alt+F2.

  2. Type gksu gedit /etc/default/rcS and press Enter.

  3. You'll probably see this:

    # assume that the BIOS clock is set to UTC time (recommended)
    • If you do, change UTC=yes to UTC=no. (Or you might want to add a comment too, by changing it to something like UTC=no # changed to accommodate Windows system. Everything on a line after a # character is a comment, and is there just to make your settings more human-readable.)
    • If you don't, look for any UTC= line. If it's uncommented (i.e., doesn't have a # at the beginning), change it accordingly. If it is commented, uncomment it by removing the leading # and make sure it says UTC=no.
  4. Save the file and quit the text editor.

  5. Reboot to apply your changes and check that the time is working properly now on both operating systems.


(But that is very general; I have written this answer to apply specifically to your situation, which is a somewhat common problem.)

share|improve this answer
Note that this can also occur when you upgrade from one Ubuntu release to the next, like it did for me. I can recommend performing the above fix, and then also manually syncing your clock as in this answer (adjusting it to work with systemd): – starbeamrainbowlabs Jun 20 at 20:03

To set the BIOS clock to local time instead of UTC in a systemd-based version (15.04 and above), you will have to use the timedatectl command. According to the Arch Wiki:

You can set the hardware clock time standard through the command line. You can check what you have set to use by:

$ timedatectl | grep local

The hardware clock can be queried and set with the timedatectl command. To change the hardware clock time standard to localtime, use:

# timedatectl set-local-rtc 1

If you want to revert to the hardware clock being in UTC, do:

# timedatectl set-local-rtc 0
share|improve this answer

The /etc/rcS fix did not work on my Win7 / Ubuntu 14.04x64 installation, nor did any fixes through the clock GUI. Because the root of the problem is BIOS time VS UTC time, and Windows is a pain in the butt when it comes to using UTC, I just picked a point on the map that uses UTC+0 (no change between BIOS and UTC time).

Try changing your location to Reykjavik (the capital of Iceland). Voila! Your Ubuntu time will change to match your BIOS time.

share|improve this answer
Haha! Awesome. :D I really don't care my location. This was two seconds fix. Thanks a lot. – bludger Mar 10 '15 at 9:05


Click the clock in the toolbar and click Date & Time Settings.

On the Clock tab. check the box for Time in auto-detected location and the clock should correct immediately."

share|improve this answer
This switch is mostly avail in KDE desktops version < 4.x. (Kubuntu and similar) I found this by rightclicking on the time and choosing: "settings for digital clock". In the new window there is a button for *appearance, *general, *calendar, *time zones and *keyb shortcuts. In "time zones" there was a tick under "UTC". Just remove this and tick your Town/Country closest. (But keep in mind that you should read the following as well about UTC: regards! – Peterling Apr 27 at 18:56

protected by Community Apr 18 '14 at 15:49

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.