Ubuntu – Why does time change in Ubuntu after installing Windows

dual-boottimewindows 7

Today I was installing Windows 7 on the same computer I have Ubuntu. For some reason, after installing Windows 7 and going back to Ubuntu the time went from the correct hour at that moment, 12:30PM to 7:30AM. This happened after installing Windows 7. For what I understand the BIOS has a time set, Ubuntu has the same time that is shown in the BIOS when installing it. At least up to this point is what I have seen. Now after installing Windows 7 (And believe me this is only for testing the performance of Windows 7 against Ubuntu in which case Windows 7 is falling behind a lot on the same hardware) the time changes in Ubuntu to the wrong one that is set in Windows 7.

I actually do not change the time in Windows 7 since this is one of the checks I am doing to see if the operating system can correctly grab the time. Windows 7 fails. Ubuntu does not BUT Windows 7 actually changes the time for Ubuntu if I boot with it afterwards.

So my question is, why/how does time change in Ubuntu after installing Windows.

NOTE – I have set Ubuntu time to "manual" instead of grabbing it from the Internet just to test out this.

Best Answer

Because of the way the two operating systems set the hardware clock. by Default ubuntu uses UTC, and windows localtime.

So when you shut down, your hard ware clock is set to say "13:00". When you boot, windows sees "13:00" as localtime, so 1 PM, but Ubuntu sees that as UTC and so converts the time back from UTC to local time.

You can fix this by either asking windows to set the hardware clock with UTC, or Ubuntu to use localtime.

to make the change in Ubuntu, edit edit /etc/default/rcS and change

UTC=yes to no, like this:

# assume that the BIOS clock is set to UTC time (recommended)
UTC=no

See:

https://help.ubuntu.com/community/UbuntuTime#Multiple_Boot_Systems_Time_Conflicts

Related Question