Windows linux dualboot time

Dual boot wrong time on windows [duplicate]

I had my Windows 10 installation, but then I decided to dual boot with Linux. I did it, and I noticed, that I have -2h on the clock on my Linux. I’ve searched the internet for the answer (the time zone was good). I don’t really remember what I did, but I do remember setting ntp to true and hwlclock systohc —rtc , or something like this. Now the time on my Linux is good, but the time on Windows is 2 hours late. I have to manually go to Adjust date/time -> Sync now to make it right. I know this is messy, but I can’t quite remember what exactly I did on Linux. Now the situation is like this. Is there a way to fix it? Or maybe force Windows to automatically sync, or something?

2 Answers 2

There are multiple ways to do this as per:

What I’d prefer and have done is executing this command on Linux: timedatectl set-local-rtc 1

Windows an Linux handle time differently, so interpret differently the setting of hardware clock.

While Linux stores the time on the hardware clock as UTC by default, Windows stores the time on the hardware clock as the ‘local’ time.

The simplest solution would be to have both use a time server to update the hardware clock after booting.

Surprisingly enough, with NTP enabled on Linux, and «automatic time» on Windows, the time is still always wrong on Windows when rebooting. In Linux it works fine, I guess NTP does a good job. Disabling and enabling the automatic time «fixes» it. Slightly infuriating.

Источник

Fix Incorrect Time in Windows 11 That Dual boot with Ubuntu Linux

For those dual boot Windows 11 with Ubuntu or other Linux, you’ll find different time display in each system. And usually Windows shows the incorrect clock time.

There are two time standards, localtime and Coordinated Universal Time (UTC, aka GMT). The local time standard is dependent on the current time zone, while UTC is the global time standard that is independent of time zone.

Читайте также:  Astra linux special edition руководство администратора часть 2

By default, Windows uses localtime, but Ubuntu uses UTC. So you get the different time in the dual boot. And the solution is set the same time standard in the two systems.

Method 1.) Set RTC to local time zone in Ubuntu:

Though it’s not recommended, set the Real Time Clock (RTC) to use local time zone just works.

Firstly, open terminal either from system app launcher or by pressing Ctrl+Alt+T on keyboard. When it opens, run command:

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

Then you can check system clock status via command:

And “RTC in local TZ: yes”, where TZ means time zone, tells localtime standard is in use.

As I said “it’s not recommended“, it warns that localtime standard may cause various problems with time zone changes and daylight saving time adjustments.

You can restore UTC time standard and do method 2 instead by running command:

timedatectl set-local-rtc 0

Method 2.) Enable UTC time in Windows 11:

If you’re now running Windows 11, you can easily enable the UTC / GMT time standard via following steps.

1. Firstly, click on ‘Search’ icon on task bar. Then search for and right-click on ‘Command Prompt’ and select ‘Run as administrator’.

2. When command prompt opens, copy and paste the command below and hit run:

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

The command creates a registry key to tell Windows to use universal time standard.

Refresh the display time to apply change:

If Windows 11 shows the incorrect date and time, search for and open “Settings” from start menu. Then go to “Time & Language” from left pane, click “Date & time” and finally disable and re-enable ‘Set time automatically’ option will correct your system time.

For Ubuntu users, it may also display incorrect time when “Automatic Date & Time” not enabled. Simply enable or refresh the option in System “Settings -> Date & Time” will do the trick.

permalink

Ji m

I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

Источник

Сбивается время при переключении систем в дуалбуте

Jul 4, 2021 13:02 · 292 words · 2 minute read админство

У меня на ноутбуке установлено 2 ОС: Linux Mint и Windows 10. Первая — для работы, вторая — для Steam. Переключаюсь поиграть я не так чтобы часто, но в этот раз меня окончательно достал сброс времени при возврате в linux на 3 час, так что я решил всё-таки разобраться в проблеме. Мой часовой пояс Europe/Moscow UTC+3, значит где-то не происходит перевод из datetime with timezone в naive datetime или наоборот. И что же может быть общего между двумя ОС на разных разделах диска? Вероятно, только BIOS (или grub, но вряд ли проблема там). В BIOS тоже есть часы, и зовутся они RTC (real time clock)!

Читайте также:  Astra linux directory доверительные отношения

Чтобы убедиться, что проблема в них, проведём небольшой эксперимент и попереключаемся между ОС, но с заходом в BIOS. Сейчас время правильное, гибернетим linux -> заходим в BIOS, время на 3 часа меньше. То есть linux работает со временем с таймзоной, а сохраняет в BIOS время в UTC. Загружаемся в Windows, там верное время. Заходим в BIOS — и видим там локальное, а не в UTC! Значит, проблема в RTC — каждая ОС ставит его по-своему.

  • заставить Windows сохранять время в UTC
  • заставить linux сохранять время в локальном варианте

Я не очень хорошо знаком с администрированием Windows, так что мне кажется второй вариант наиболее простым. За время в linux отвечает одна из утилит из состава systemd — timedatectl.

Вывод timedatectl

Нас интересует последняя строчка: “RTC in local TZ: no”. Видимо, можно как-то установить в yes… Команда timedatectl set-local-rtc 1 делает именно это:

Вывод timedatectl

Обратите внимание на предупреждение! Явно это не родной режим linux, так что там могут быть проблемы (теоретически). Но переводов на летнее время у меня нет, путешествую в другую таймзону я нечасто, так что мне этот способ подходит. Перезагружаемся, проверяем и забываем об этой проблеме.

Источник

Dual Boot: Fix Time Differences Between Ubuntu And Windows

If you dual boot and there are time conflicts between Windows and Ubuntu, this occurs because Ubuntu store the time on the hardware clock as UTC by default while Microsoft Windows stores the time as local time, thus causing conflicting times between Ubuntu and Windows.

Fix time differences between Ubuntu and Windows

A. To fix the UTC / local time difference between Ubuntu and Windows from Ubuntu by making Ubuntu use local time.

Before proceeding, note that according to the Ubuntu wiki, «the advantage of having the hardware clock as UTC is that you don’t need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets«. So this is not recommended and if you can, you should use method B., and fix this from Windows.

Читайте также:  Astra linux обновить приложение

For Ubuntu 16.04 and newer, run the following command (thanks to Erwinson Pagtalunan for the update!):

timedatectl set-local-rtc 1

Which should display the following «RTC in local TZ: yes». A warning will also be displayed. Here’s the full command output:

$ timedatectl Local time: Lu 2016-04-25 12:18:22 EEST Universal time: Lu 2016-04-25 09:18:22 UTC RTC time: Lu 2016-04-25 12:18:22 Time zone: Europe/Bucharest (EEST, +0300) Network time on: yes NTP synchronized: no RTC in local TZ: yes Warning: The system is configured to read the RTC time in the local time zone. This mode can not be fully supported. It will create various problems with time zone changes and daylight saving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it. If at all possible, use RTC in UTC by calling 'timedatectl set-local-rtc 0'. 


For Ubuntu versions older than 16.04: you must edit the /etc/default/rcS file and replace «UTC=yes» with «UTC=no» (both without the quotes). To do this automatically, simply copy/paste the following command in a terminal:

sudo sed -i 's/UTC=yes/UTC=no/' /etc/default/rcS

B. To fix this from Windows (it should work with Vista SP2, Windows 7, Server 2008 R2 and Windows 8/8.1), by making it use UTC instead of local time, download THIS Windows registry file and simply double click it.

Then, to disable the Windows Time service (which still writes local time to RTC regardless of the registry setting above, on shutdown), run Command Prompt as Administrator and paste this command:

sc config w32time start= disabled

How to revert the changes

A. From Ubuntu: reverting this change from Ubuntu is pretty easy.

Ubuntu 16.04 and newer: to revert the changes, simply run the following command:

timedatectl set-local-rtc 0

Ubuntu versions older than 16.04: all you have to do is replace «UTC=no» with «UTC=yes» in the /etc/default/rcS file. To do this automatically, copy/paste the command below in a terminal:

sudo sed -i 's/UTC=no/UTC=yes/' /etc/default/rcS

Firstly, open the .reg file downloaded when applying the fix for Windows (see download link above) with a text editor and change the «RealTimeIsUniversal» value from «dword:00000001» to «-» (without the quotes). Here’s how the file should look like after making this change:

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] "RealTimeIsUniversal"=-

Then save the file and double click it.

Next, run the following command in Command Prompt (which you need to run as Administrator) to re-enable the Windows Time service:

sc config w32time start= demand

Источник

Оцените статью
Adblock
detector