How to Fix Windows And Linux Showing Different Time In A Dual Boot System

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

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).

Hardware 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 –
hwclock --show

System Clock-

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.
timedatectl

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
hwclock --systohc
Also, it updates /etc/adjtime or creates it if not present in the system.

Time Standards-

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 regedit then press enter.
  • Now navigate to the path as given below

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

  • 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.

Previous Using Sed, A Stream Editor In Linux/Unix
Next Package Management In Arch Linux

About author

You might also like

Uncategorized 0 Comments

Some Important Commands Used In Linux/Unix

0.0 00 Command-line interface(CLI) is a way that allows users to interact with computer programs through commands. A user issues commands to a program which gets interpreted by a command-line

Uncategorized 0 Comments

How To Change Bootscreen Logo In Linux Mint?

0.0 00 Bootscreen A bootscreen is a graphical representation of the boot porcess of an operating system. It can be scrolling boot messages in a console or virtual terminal. Or

Linux Topics 0 Comments

File Ownership And Permissions In Linux/Unix

0.0 00 Linux and Unix are multi-user operating systems that means different users can access the operating system at a time and can use system resources simultaneously. So the files

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply