- Dual Boot: Fix Time Differences Between Ubuntu And Windows
- Fix time differences between Ubuntu and Windows
- How to revert the changes
- How to Fix Time Differences in Ubuntu 16.04 & Windows 10 Dual Boot
- Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it
- Why Windows and Linux show different time in dual boot?
- Fixing Windows Showing Wrong Time in a Dual Boot Setup With Linux
- Fix Windows and Linux Showing Different Times When Dual Booting
- Why does this happen?
- Option 1: Make Linux use local time
- Option 2: Make Windows use UTC
- Conclusion
- 7 comments
Dual Boot: Fix Time Differences Between Ubuntu And Windows
Author : Andrew | Posted: September 08, 2014
Fix time differences between Ubuntu and Windows
A. To fix the UTC / local time difference between Ubuntu and Windows from Ubuntu by making Ubuntu use local time.
For Ubuntu 16.04 and newer, run the following command (thanks to Erwinson Pagtalunan for the update!):
You can then check if Ubuntu uses local time, you can then use the following command:
Which should display the following «RTC in local TZ: yes». A warning will also be displayed. Here’s the full command output:
For Ubuntu versions older than 16.04: you must edit the /etc/default/rcS file and replace «UTC=yes» with «UTC=no» (both without the quotes). To do this automatically, simply copy/paste the following command in a terminal:
How to revert the changes
A. From Ubuntu: reverting this change from Ubuntu is pretty easy.
Ubuntu 16.04 and newer: to revert the changes, simply run the following command:
Ubuntu versions older than 16.04: all you have to do is replace «UTC=no» with «UTC=yes» in the /etc/default/rcS file. To do this automatically, copy/paste the command below in a terminal:
Firstly, open the .reg file downloaded when applying the fix for Windows (see download link above) with a text editor and change the «RealTimeIsUniversal» value from «dword:00000001» to «-» (without the quotes). Here’s how the file should look like after making this change:
Then save the file and double click it.
Источник
How to Fix Time Differences in Ubuntu 16.04 & Windows 10 Dual Boot
For users who dual boot Ubuntu 16.04 and Windows, you may find the clock time is off that causes time differences after you reboot and switch between the two systems. Here’s how to fix it.
Ubuntu maintains the hardware clock (RTC, real time clock) in universal time (UTC) by default while Windows maintains the clock in local time, thus causing time conflicts between Ubuntu and Windows.
To fix it, either set Ubuntu to maintain RTC in local time or make Windows uses UTC.
1. Disable UTC and use Local Time in Ubuntu:
In previous Ubuntu editions, you can edit the config file /etc/default/rcS to disable UTC.
In Ubuntu 16.04, open terminal (Ctrl+Alt+T) and run the command below instead:
To check out if your system uses Local time, just run:
you’ll the local time zone is in use in the Warning section.
Finally restart and switch to Windows, adjust system clock time if need and done.
2. Make MicroSoft Windows uses UTC:
Another way to fix this issue is doing the following changes in Windows, Windows 10, in the case below:
1.) First if you’ve switched to local time in Ubuntu, run command in Ubuntu terminal to use back UTC:
2.) Restart and select boot into Windows 10, when you’re in, do:
- go to Start Menu, search for and launch cmd as Administrator.
- When the command console opens, paste below command to create a DWORD value to the registry:
For 64-bit Windows, use a QWORD value instead:
Источник
Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it
If you dual boot Windows and Ubuntu or any other Linux distribution, you might have noticed a time difference between the two operating systems.
When you use Linux, it shows the correct time. But when you boot into Windows, it shows the wrong time. Sometimes, it is the opposite and Linux shows the wrong time and Windows has the correct time.
That’s strange specially because you are connected to the internet and your date and time is set to be used automatically.
Don’t worry! You are not the only one to face this issue. You can fix it by using the following command in the Linux terminal:
Again, don’t worry. I’ll explain in detail how the above command fixes the wrong time issue in Windows after dual boot. But before that, let me tell you why you encounter a time difference in a dual boot setup.
Why Windows and Linux show different time in dual boot?
A computer has two main clocks: a system clock and a hardware clock.
A hardware clock which is also called RTC (real time clock) or CMOS/BIOS clock. This clock is outside the operating system, on your computer’s motherboard. It keeps on running even after your system is powered off.
The system clock is what you see inside your operating system.
When your computer is powered on, the hardware clock is read and used to set the system clock. Afterwards, the system clock is used for tracking time. If your operating system makes any changes to system clock, like changing time zone etc, it tries to sync this information to the hardware clock.
By default, Linux assumes that the time stored in the hardware clock is in UTC, not the local time. On the other hand, Windows thinks that the time stored on the hardware clock is local time. That’s where the trouble starts.
Let me explain with examples.
You see I am in Kolkata time zone which is UTC+5:30. After installing, when I set the timezone in Ubuntu to the Kolkata time zone, Ubuntu syncs this time information to the hardware clock but with an offset of 5:30 because hardware clock (RTC) has to be in UTC for Linux.
Let’ say the current time in Kolkata timezone is 15:00 which means that the UTC time is 09:30.
Now when I turn off the system and boot into Windows, the hardware clock has the UTC time (09:30 in this example). But Windows thinks the hardware clock has stored the local time. And thus it changes the system clock (which should have shown 15:00) to use the UTC time (09:30) as the local time. And hence, Windows shows 09:30 as the time which is 5:30 hours behind the actual time (15:00 in this example).
set time windows
Again, if I set the correct time in Windows by toggling the automatic time zone and time buttons, you know what is going to happen? Now it will show the correct time on the system (15:00) and sync this information (notice the “Synchronize your clock” option in the image) to the hardware clock.
If you boot into Linux, it reads the time from the hardware clock which is in local time (15:00) but since Linux believes it to be the UTC time, it adds an offset of 5:30 to the system clock. Now Linux shows a time of 20:30 which is 5:30 hours ahead of the actual time.
Now that you understand the root cause of the time difference issues in dual boot, it’s time to see how to fix the issue.
Fixing Windows Showing Wrong Time in a Dual Boot Setup With Linux
There are two ways you can go about handling this issue:
- Make Windows use UTC time for the hardware clock
- Make Linux use local time for the hardware clock
It is easier to make the changes in Linux and hence I’ll recommend going with the second method.
Ubuntu and most other Linux distributions use systemd these days and hence you can use timedatectl command to change the settings.
What you are doing is to tell your Linux system to use the local time for the hardware clock (RTC). You do that with the set-local-rtc (set local time for RTC) option:
As you can notice in the image below, the RTC now uses the local time.
Now if you boot into Windows, it takes the hardware clock to be as local time which is actually correct this time. When you boot into Linux, your Linux system knows that the hardware clock is using local time, not UTC. And hence, it doesn’t try to add the off-set this time.
This fixes the time difference issue between Linux and Windows in dual boot.
You see a warning about not using local time for RTC. For desktop setups, it should not cause any issues. At least, I cannot think of one.
I hope I made things clear for you. If you still have questions, please leave a comment below.
Like what you read? Please share it with others.
Источник
Fix Windows and Linux Showing Different Times When Dual Booting
If your system dual boots both Windows and Linux, you might notice that it’s impossible to get the system clocks to sync. No matter how you change the clock in one OS, it doesn’t fix the problem with the other OS. This is because of a disagreement about time-keeping methodology between Windows and Unix-based operating systems. Fortunately, there’s a relatively easy fix for that.
Why does this happen?
Your computer stores the current time in a clock on your motherboard. This allows the computer to keep track of time even when turned off. To account for time zones, different operating systems use different methods. Windows assumes the local time is stored in the motherboard, so it doesn’t apply any kind of time zone offset. Linux, on the other hand, will interpret the time on the motherboard as UTC (a.k.a. Greenwich Mean Time) and apply a timezone offset to display local time.
Both of these systems work perfectly fine independently. The problem occurs when you dual boot a system, running Windows and Linux off the same motherboard. When the operating systems are forced to share a time store, the clocks won’t sync.
There are two different ways we can fix this problem: we can change how Linux interprets the stored time or do the same to Windows.
Option 1: Make Linux use local time
The most reliable way to make Linux and Windows agree on the time is to change Linux’s time keeping methodology. While this isn’t explicitly supported, it’s slightly more reliable than doing the same in Windows. It works on any flavor of Linux using systemd , which includes Ubuntu, Fedora, Red Hat, Debian, and Mint. Changing the Windows time typically works fine too, but it can sometimes lead to instabilities in third-party software that expects the stored time to be local time.
1. Open Terminal and run the following command:
This will tell the system to interpret your motherboard’s stored time as local time. Linux will no longer apply time zone adjustments to the time stored on the motherboard. As a result, your clocks will sync.
If you ever need to reverse the command, change the 1 to a 0:
Option 2: Make Windows use UTC
You can also change the way that Windows views system time. This tweak will cause Windows to interpret the time stored on the motherboard as UTC, which Linux can then interpret as the correct time zone. While this generally works well, some applications rely on motherboard time being local time. As a result, hard-to-track bugs can sometimes appear. That makes this option slightly less desirable than the first.
1. Disable “Set time automatically” under “Time & Language” in the Settings application. This will prevent Windows from reverting the changes we’re about to make.
2. Open Registry Editor by typing regedit in the Start Menu.
3. Find the following registry key in the left pane of the registry editor. To get there quickly, paste the location into the registry editor’s address bar:
4. Right-click on the “TimeZoneInformation” key in the left pane and chose “New -> DWORD (32-bit) Value” from the context menu.
5. Name your new value “RealTimeIsUniversal.”
6. Double-click on the value you just created, set its value to “1,” and click “OK.”
Conclusion
The safest way to sync your system clocks on a dual-booting system is to adjust how Linux interprets time. If that doesn’t work for you (or if you’re using macOS instead of Linux), you can also edit the Windows registry to change the way Windows understands motherboard time.
Alexander Fox is a tech and science writer based in Philadelphia, PA with one cat, three Macs and more USB cables than he could ever use.
7 comments
What if your dual-boot system requires Linux to use UTC/GMT, due the system network to which it connects, and requires Windows to use local time, due it connecting to the internet via a separate physical intranet connection? i.e. NIC #2 enabled and NIC #1 disabled in Linux, and NIC #2 disabled and NIC #1 enabled in Windows.
What would be safest way to sync the clocks to their separate networks without having to manually change the clock when booting to the opposing OS?
Maybe add a second clock to sync against. Make a mod. I use to see clocks that I could add to simple systems. You could write scripts to sync against it accordingly. One for linux the other for windows. Or if you can get network before a clock sync you could use ntp to sync against.
Nice tip! I used Option 1 and it worked perfectly (Windows 7 / Ubuntu 16.04). Thanks a lot!
Being that I primarily use linux might have to do with my bias but UTC time is the correct time to have on the BIOS. It allows for better uniformity. Programs that have issues with this are the problem and should be reported as bugs in those programs. Why Microsoft’s default setting is still local time is beyond me.
I solved the problem by removing Windoze. Best move I ever made when it comes to computers.
Why can’t Linux just run it like Windows which would make more sense because so many users duel boot Linux and Windows. This goes back awhile now and everyone says its so simple to fix, so why isn’t it fixed by now instead of users having to fiddle with this stuff?
We might as easily ask why Windows doesn’t switch to the method used by Unix systems.
I would not characterize this as a flaw or an error. From an abstract perspective, it’s two non-compatible software suites approaching the same problem in different ways and causing an inconsistency for the user. It’s well outside the bounds of what any operating system needs to support.
Источник