[root tip] [How To] Get your time/timezone right using Manjaro/Windows dual-boot

Difficulty: ★☆☆☆☆

The woes of dual-booting Manjaro/Windows

Windows defaults to setting the (RTC) real-time-clock to local-time and Linux sets RTC in UTC (universal-time).

This makes your time/timezone floating in space where it may be in doubt what time it actually is.

Manjaro configuration

The best approach to keep both working is to set your RTC (hardware clock) to UTC

# timedatectl set-local-rtc 0

or use

# hwclock --systohc --utc

And enable a network-time-daemon on Linux.

# systemctl enable --now systemd-timesyncd

Ensure your timezone is correct linking it to your /etc/localtime e.g for Jerusalem (Replace in the command below Continent/City case sensitive location)

# ln -sf /usr/share/zoneinfo/**Asia**/**Jerusalem** /etc/localtime

The get a list of supported zone groups (Continent)

find /usr/share/zoneinfo/ -maxdepth 1 -type d

Then list the content of your selected zone e.g. Asia (Cities)

ls /usr/share/zoneinfo/Asia

Windows configuration

Next step is to boot into Windows and instruct Windows to handle the hardware clock in UTC.

This is done by adding an entry to the system registry. To avoid messing with the Registry Editor (regedit.exe) creating a file to import is the safest method.

Create a file on your Windows system using Notepad (notepad.exe) and name it utc.txt and save it on your desktop.

Rightclick your desktop → New → Text document

Copy/Paste below content as you need absolutely no errors.

Depending on your version of Windows this may work.

Older versions of Windows may import the file without complaints

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient]
"Enabled"=dword:00000000

Newer versions presumably Windows 10 requires the registry editor version and an empty line

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient]
"Enabled"=dword:00000000

When you have saved the file, open a command prompt and navigate to your Desktop folder and rename the file to utc.reg.

C:\Users\username> cd Desktop
C:\Users\username\Desktop> move utc.txt utc.reg

When you have renamed the file it can be imported into the registry by double clicking the .reg file found on your desktop.

Accept the disclaimer to import the keys and reboot your system.

The end result

Besides letting Windows use the systems RTC the registry keys also disables the Windows NTP client - so only Manjaro will adjust your clock.

14 Likes

Hi !

I did what you explained in this post. All of it.

It worked for a boot but then, my time went to the same state as before.

What could be causing this ?

Is the windows part supposed to work with win7 ? If not it’s probably windows that’s screwing up (it probably is win screwing anyway, but I’m not sure how)

Germanisch:
Manjaro Einstellungen > Zeit und Datum >
1.) setze Datum und Uhrzeit automatisch
2.) Echtzeit-Uhr in der lokalen Zone.

Windows benutzt die lokale Zeitzone im Anlieferungszustand.

1 Like

I think so - but I don’t know for sure - after alll this is a Linux forum - not Windows.

2 Likes

Thank you very much, danke! Your method is simple and effective :slight_smile:

2 Likes

This simple method uses local-time (depending on time zone) in Mainboard BIOS and is the same as
$ sudo timedatectl set-local-rtc true

But it will break something in Linux e.g. journalctl issue. :wink:

2 Likes

I don’t remember the exact term, but afair 64-bit Windows uses QWORD64 type of registry key instead of DWORD, which (the latter) has no effect on 64-bit systems. At least I had such experience about 5 years ago.

Very bad idea - easy - but really bad advise

dword is the correct value type on all current Windows systems

1 Like

Corrected this.
Windows 10 registry altered like linux-aarhus wrote.

Doing this on win11 in may 2023 did not work for me.

I ended up changing HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient to 1 again, that way I can still sync it to the internet servers. The time will not sync with my hw clock.
So I’m not sure any of the changes I made any difference for me.

This worked like magic for me!
Thank you @Zesko for this great tip!

I am dual booting and my Windows 10 would always display the wrong time after I had previously booted into Manjaro.
Manjaro also took half a minute before displaying the correct time.
My BIOS doesn’t give me the option to change it to UTC time, however forcing Manjaro to use the local time did the trick.

No firmware does give such option. You simple set the hardware clock.

Setting the hardware clock to current datetime will work for windows because it assumes localtime.

Setting the hardware clock to local time may work, but you will - when e.g. daylight savings time is applied - get a flux where your time begins floating and you will grow greyhair when the time comes. It is like wetting yourself, outside, in freezing temperature - it warms - but then it get’s even colder.

To have Linux and Windows to co-exist, without weird changes of the time - you need to use UTC and configure Windows to use UTC.

I highly doubt Windows would change such a vital component from win10 to win11 as @bedna states in his comment.

It works on my computer while having HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient set to 0 meant I was unable to change the time in windows 11 AND the time was wrong, I therefore provided a solution that worked for me.

Please do not tag me just to call me a liar.

@linux-aarhus Noted, although the growing grey hair part would be a bonus for me, I’m as bald as can be! :rofl:

Many thanks for the tip, it is appreciated!