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.
https://help.ubuntu.com/community/UbuntuTime#Multiple_Boot_Systems_Time_Conflicts
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: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:
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 hasUTC=no
:Press Alt+F2.
Type
gksu gedit /etc/default/rcS
and press Enter.You'll probably see this:
UTC=yes
toUTC=no
. (Or you might want to add a comment too, by changing it to something likeUTC=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.)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 saysUTC=no
.Save the file and quit the text editor.
Reboot to apply your changes and check that the time is working properly now on both operating systems.
Source: https://help.ubuntu.com/community/UbuntuTime#Make_Linux_use_.27Local.27_time
(But that is very general; I have written this answer to apply specifically to your situation, which is a somewhat common problem.)
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.
We can ask Windows to sync time with the network on every reboot:
On Ubuntu, we can set "Automatic Date & Time" in settings, and by default, it runs on every reboot automatically.
This is my favorite approach as it does not require modifying the registry or setting Linux to use "local" time, which might have side effects such as daylight saving time synchronization.
See this answer and this answer for more reference.
I had 1h of difference on each time I boot into linux or windows. It's because one is on UTC ant the other one in RTC
To fix my ubuntu 20.04 I used this:
in my case to go back to UTC you can
and if you want to check what you're using you can type that:
timedatectl