Top Tags

Fix Windows system time when it installed alongside with Linux

How to fix Windows system time with Linux

Understanding the Problem

When dual-booting Windows and Linux on the same machine, you may notice that the system time changes when switching between operating systems. This occurs due to fundamental differences in how Windows and Linux handle the hardware clock (RTC - Real-Time Clock).

Technical Background

Hardware Clock vs System Clock:

  • RTC (Real-Time Clock): A battery-powered clock on the motherboard that keeps time even when the computer is off. Also known as the BIOS clock or CMOS clock.
  • System Clock: The software clock maintained by the operating system kernel while the system is running.

The Core Issue:

Windows and Linux use different time standards for the hardware clock:

  1. Windows: Treats the RTC as local time by default

    • The hardware clock stores the actual local time (e.g., 3:00 PM EST)
    • Windows applies timezone offset to calculate UTC
    • This approach dates back to MS-DOS compatibility
  2. Linux/Unix: Treats the RTC as UTC (Coordinated Universal Time) by default

    • The hardware clock stores UTC time
    • Linux converts UTC to local time using timezone settings
    • This is the POSIX standard approach

Why This Causes Problems:

When you boot into Linux, it reads the RTC as UTC and converts it to local time. If Windows previously set the RTC to local time (e.g., EST -5), Linux interprets this as UTC and displays the wrong time. Similarly, when booting back to Windows, it reads the UTC time set by Linux as local time, causing another offset.

Solution Approaches

There are two ways to resolve this conflict:

This approach makes Linux behave like Windows, treating the RTC as local time.

On Windows set timezone to manual

On Linux:

bash
1timedatectl set-local-rtc 1 --adjust-system-clock

What this command does:

  • timedatectl: System utility to control system time and date settings
  • set-local-rtc 1: Configures the system to maintain RTC in local time (1=true, 0=false/UTC)
  • --adjust-system-clock: Immediately synchronizes the system clock with the new RTC interpretation

Verify the configuration:

bash
1timedatectl status

Look for the line RTC in local TZ: yes to confirm the change.

Advantages:

  • Simple one-line fix on Linux
  • No changes required to Windows
  • Ideal for dual-boot desktop systems

Disadvantages:

  • Deviates from Linux/Unix standard practice
  • Can cause issues with daylight saving time transitions
  • May affect time synchronization with NTP servers

Option 2: Configure Windows to Use UTC (Advanced Users)

This approach makes Windows behave like Linux. This requires modifying the Windows Registry.

On Windows (Run as Administrator):

Create a registry entry to enable UTC for the RTC:

cmd
1reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f

For 64-bit Windows systems, you may also need:

cmd
1reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_QWORD /f

PowerShell equivalent:

powershell
1Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Value 1 -Type DWord

Revert if needed:

cmd
1reg delete "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /f

Advantages:

  • Keeps Linux in its standard UTC configuration
  • Better for systems that sync time frequently
  • Handles daylight saving time more reliably

Disadvantages:

  • Requires registry modification
  • May cause issues with some Windows software
  • Windows updates might reset this setting

Technical Details: timedatectl Command

The timedatectl utility is part of systemd and provides comprehensive time management:

View Current Status:

bash
1timedatectl

Output interpretation:

Local time: Tue 2026-01-14 15:30:45 EST Universal time: Tue 2026-01-14 20:30:45 UTC RTC time: Tue 2026-01-14 15:30:45 Time zone: America/New_York (EST, -0500) System clock synchronized: yes NTP service: active RTC in local TZ: yes

List Available Timezones:

bash
1timedatectl list-timezones

Set Timezone:

bash
1sudo timedatectl set-timezone America/New_York

Enable NTP Synchronization:

bash
1sudo timedatectl set-ntp true

Troubleshooting

Time Still Incorrect After Changes

  1. Manually sync the system clock:
bash
1sudo hwclock --systohc

This writes the current system time to the hardware clock.

  1. Check if NTP is synchronizing:
bash
1timedatectl timesync-status
  1. Force NTP sync:
bash
1sudo systemctl restart systemd-timesyncd

Daylight Saving Time Issues

If you're using the local RTC approach, disable automatic DST updates in Windows:

  1. Open Settings → Time & Language → Date & Time
  2. Disable "Set time automatically"
  3. Disable "Set time zone automatically"
  4. Enable "Adjust for daylight saving time automatically"

Check Hardware Clock Directly

Read RTC:

bash
1sudo hwclock --show

Compare RTC with system time:

bash
1sudo hwclock --show && date

Best Practices

  1. Choose one standard: Decide whether to use UTC or local time and configure both systems accordingly
  2. Use NTP: Enable Network Time Protocol on both systems to keep clocks synchronized
  3. Document your choice: Note which method you used in case you need to reinstall
  4. Test after daylight saving: Verify time is correct after DST transitions

Additional Notes

  • Triple-boot systems: If you have macOS in the mix, it also uses UTC by default like Linux
  • Virtual machines: VMs typically handle time differently; these issues usually don't affect VM guests
  • UEFI vs BIOS: Modern UEFI systems still maintain a single RTC that both OSes share
  • Windows 11: The registry method works on Windows 11, though Microsoft doesn't officially support it