- Clock shows wrong time after switching from Ubuntu to Windows 10 [duplicate]
- 1 Answer 1
- Solution 1: Make Windows use UTC
- Reversing the change
- Solution 2: Make Linux use ‘Local’ time
- Fix Incorrect Time in Windows 11 That Dual boot with Ubuntu Linux
- Method 1.) Set RTC to local time zone in Ubuntu:
- Method 2.) Enable UTC time in Windows 11:
- Refresh the display time to apply change:
- Ji m
- 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
- Method 1: Make your OS set time and date automatically
- Method 2: Make Ubuntu use local time for hardware clock
Clock shows wrong time after switching from Ubuntu to Windows 10 [duplicate]
I have dual booted Windows 10 and Ubuntu 16.04 in UEFI mode (secure boot off). My time in BIOS is correct. When I boot into Ubuntu and then boot into Windows 10, it shows the wrong time. I have to correct it manually or by the internet in Windows 10, and when I reboot into Windows 10 then it is not a problem. The clock will show the correct time. And then when I reboot to Linux the clock is correct, but switching back to Windows 10 the clock messes up again.
Ubuntu is set for UTC time and Windows is not. You need to set your Windows for UTC time as well. Check out superuser.com/questions/185773/…
thanks Terrance. I had asked this question on windows forums and they are just making me move round and round and then they left it unanswered
Not a problem. It’s best to leave Ubuntu at UTC and set Windows to UTC. I have done it and noticed no problems. =)
1 Answer 1
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.
Solution 1: 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 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] "RealTimeIsUniversal"=dword:00000001
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
If running the above command in Powershell, you’ll have to specify sc.exe:
sc.exe 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 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] "RealTimeIsUniversal"=-
If Windows Time service was disabled, enable it again with the command:
sc config w32time start= demand
Solution 2: Make Linux use ‘Local’ time
# Set UTC=yes if your hardware clock is set to UTC (GMT) UTC=no
timedatectl set-local-rtc 1
Fix Incorrect Time in Windows 11 That Dual boot with Ubuntu Linux
For those dual boot Windows 11 with Ubuntu or other Linux, you’ll find different time display in each system. And usually Windows shows the incorrect clock time.
There are two time standards, localtime and Coordinated Universal Time (UTC, aka GMT). The local time standard is dependent on the current time zone, while UTC is the global time standard that is independent of time zone.
By default, Windows uses localtime, but Ubuntu uses UTC. So you get the different time in the dual boot. And the solution is set the same time standard in the two systems.
Method 1.) Set RTC to local time zone in Ubuntu:
Though it’s not recommended, set the Real Time Clock (RTC) to use local time zone just works.
Firstly, open terminal either from system app launcher or by pressing Ctrl+Alt+T on keyboard. When it opens, run command:
timedatectl set-local-rtc 1 --adjust-system-clock
Then you can check system clock status via command:
And “RTC in local TZ: yes”, where TZ means time zone, tells localtime standard is in use.
As I said “it’s not recommended“, it warns that localtime standard may cause various problems with time zone changes and daylight saving time adjustments.
You can restore UTC time standard and do method 2 instead by running command:
timedatectl set-local-rtc 0
Method 2.) Enable UTC time in Windows 11:
If you’re now running Windows 11, you can easily enable the UTC / GMT time standard via following steps.
1. Firstly, click on ‘Search’ icon on task bar. Then search for and right-click on ‘Command Prompt’ and select ‘Run as administrator’.
2. When command prompt opens, copy and paste the command below and hit run:
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f
The command creates a registry key to tell Windows to use universal time standard.
Refresh the display time to apply change:
If Windows 11 shows the incorrect date and time, search for and open “Settings” from start menu. Then go to “Time & Language” from left pane, click “Date & time” and finally disable and re-enable ‘Set time automatically’ option will correct your system time.
For Ubuntu users, it may also display incorrect time when “Automatic Date & Time” not enabled. Simply enable or refresh the option in System “Settings -> Date & Time” will do the trick.
Ji m
I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1
Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it
If you dual boot Windows and Linux, you’ll notice that often one of them shows incorrect time. Here’s why that happens and what you can do 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:
timedatectl set-local-rtc 1
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). 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
- Make both Ubuntu and Windows check for date, time and timezone automatically via internet
- Make Linux use local time for the hardware clock
- Make Windows use UTC time for the hardware clock
I’ll discuss two of them which are easier.
Method 1: Make your OS set time and date automatically
What happens in this case is that though your operating system (be it Windows or Linux) will show the incorrect time for a minute, and then it automatically sets the correct time if you are connected to the internet.
To make your Ubuntu Linux system check for date and time automatically, go to System Settings -> Date & Time and enable both options.
You should do a similar settings change for Windows as well.
Method 2: Make Ubuntu use local time for 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:
timedatectl set-local-rtc 1
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.