How to Fix Windows And Linux Showing Different Time In A Dual Boot System
There are many users who use a dual boot computer. Dual-booting Linux with Windows operating system has various advantages like both the operating systems have full access to the host machine as these are running natively, Linux provides various free tools to the developers while Windows is more user-friendly. Using a multiboot system in a virtual machine is easy but more resource-intensive. Dual-booting sometime leads to time conflict which means one of the operating systems shows the wrong time. Ahead in this article, we will see why this occurs and how can we fix it.
System time is the current date and time of day. It is measured by a system clock. The time is determined in four parts that are time value, local time or UTC, time zone and daylight saving time(DST) if applicable. There are two types of clocks that are present in a system; the first one is a hardware clock, and the other is a system clock(software clock).
A computer has a battery-driven hardware clock which is also known as a real-time clock(RTC) or CMOS clock. This clock works even if the system is shutdown or currently is in rest. This clock can be set from the BIOS setup in a system or can be set from the system clock.
To see the hardware clock time you can use the command that is given below. To execute it you need to be a root user –
A system clock is also known as a software clock. During the boot, A system clock takes its initial value from the hardware clock and After this, it runs independently from the hardware clock. An operating system maintains its own clock because looking at the hardware is slow and complicated.
To see the current system clock time use the command that is given below. It also displays the RTC time.
Set system clock-
timedatectl set-time "yyyy-MM-dd hh:mm:ss"
Set hardware clock from system clock-
To set the hardware clock from system clock use the command that is given below
Also, it updates
/etc/adjtime or creates it if not present in the system.
Two types of time standards are localtime and coordinated universal time(UTC). The local time standard depends on the time zone while UTC is independent of it. By default Windows operating system uses localtime standard while Linux and many other Unix based system uses UTC time standard which results into time conflict. So it is recommended to use a unique standard for hardware clock to avoid the conflict among the systems.
Network Time Protocol-
NTP is a protocol designed to synchronize the clocks of computers over a network. It synchronizes all the participating computers in a network within a few milliseconds of UTC. It was developed in 1985 by D.L. Mills at the University of Delaware. And is one of the oldest protocols that are still in use. Originally it was developed for the Linux operating system later a simplified version of it i.e Simple network time protocol(SNTP) is used by Microsoft in windows operating system.
To fix the issue of time mismatch across different operating systems in a multi-boot pc It is recommended to use a unique time standard of all. Similarly, to fix this issue in windows and Linux dual boot system you can use the following two ways-
Fix The Issue-
1. Make Linux To Use Localtime Standard-
The problem with the localtime is that it depends on time zone values. So when you are traveling between different time zone It may not changes as expected. Execute the given command to make your Linux os to use localtime standards.
timedatectl set-local-rtc 1 --adjust-system-clock
To revert it back to use UTC execute the given command into your terminal-
timedatectl set-local-rtc 0 --adjust-system-clock
2. Make Windows To Use UTC As Time Standard-
UTC is independent of time zone value. So traveling between different time zone does not affect your system time. A windows os can be set to use UTC time standard by simple registry fix. You can edit a registry in two ways –
Editing in GUI-
- Press Windows+R on your windows os and type
regeditthen press enter.
- Now navigate to the path as given below
- Finally, right-click on the screen and add a DWORD value for 32bit windows or QWORD for 64bit
with hexadecimal value 1 to the registry
OR Editing it through command prompt-
- Click on start button in windows operating system and type cmd
- Once it appears in menu right-click on it and run it as administrator
- Type the following in command prompt and press enter
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_QWORD /f
(use DWORD instead of QWORD for 32 windows os)
Hopefully, this will fix the issue of time conflict that occurs in different operating systems in a multi-boot computer. If you still find any problem regarding this you can write to us below.
You might also like
Slackware is a Linux distribution developed by Patrick Volkerding initially it was released in 1993. The distribution was based on the Softland Linux system which was one of the first
Sed stands for stream editor It was based on the scripting feature of ed(a line based interactive text editor in Unix). It is used to perform basic text transformation on
Searching a file manually in Linux or Unix can be a little bit challenging especially for new users. Linux/Unix provides various command-line tools that can be used to accomplish this