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

How To Use Nmap For Scanning A Port?

There are lots of network mapping and security auditing tools available for reviewing and analyzing a computer network for possible security vulnerabilities and loopholes. These tools can be used by

Uncategorized 0 Comments

How To Add/Remove A Software Repository In Linux?

Software Repository A software repository also known as ‘repo’ in common language is the database of software packages stored on a remote server. It also contains metadata of packages. Generally,

Uncategorized 0 Comments

Virtualization In Linux With Xen

Virtualization Technology Virtualization means creating a virtual version of something like computer hardware, storage devices, and network resources, etc. It allows you to create multiple simulated environments from a single

1 Comment

  1. june
    January 22, 10:45 Reply

    Option 2 worked like a charm for me. Thanks! 🙂

Leave a Reply