Windows 10 bios time utc

Categories:

  • Компьютеры
  • IT
  • Cancel

Эту операцию необходимо провести всем дуалбутчикам к которым с недавнего времени отношусь и я. В противном случае у вас при перезагрузке в Windows будет показываться совершенно непонятное смещение времени.

В реестре необходимо создать или изменить параметр:

[HKEY_LOCAL_MACHINE\SYSTEM\CurentControlSet\Control\TimeZoneInformation]
«RealTimeIsUniversal»=dword:00000001

Ну, а кому сейчас легко :)

If you are running multiple operating systems, configuring all systems to run in UTC may be to avoid time problems.

This will keep the same time on all systems, making it easier to work with files, messages, and other data that contain timestamps.

Configuring Windows to run on UTC can make it easier to deal with daylight saving time/winter time, as well as help avoid problems with the real time clock on your computer.

Configuring Windows for UTC (Coordinated Universal Time) can be useful in several ways:

  • Working with multiple operating systems: If you are running multiple operating systems on the same computer, configuring all operating systems to use UTC can help you avoid problems with the time.
  • Working with servers: If you are working with servers in different time zones, using UTC can help synchronize time between servers and avoid timestamp problems.
  • Working with programs that require UTC: Some programs may require UTC, so configuring Windows to use UTC can help you avoid problems with these programs.
  • Making Daylight Saving Time/Winter Time Easier: If you live in a region that uses Daylight Saving Time/Winter Time, configuring Windows for UTC can make it easier to work with Daylight Saving Time and avoid problems with the time.
  • Avoiding real-time clock problems on your computer: Some computers may have real-time clock problems that can cause the operating system and programs to malfunction. Configuring Windows to use UTC can help avoid these problems.

In general, using UTC as the time standard is the recommended approach in modern computer systems and applications. UTC is the time standard used worldwide, and its use helps avoid time problems that can occur when working in different time zones.

Windows uses local time by default to display the time in the user interface and in system files. However, if you need to configure Windows to run on UTC (Coordinated Universal Time), you can do so by following these steps:

  1. Open the registry editor by pressing Win+R and typing the regedit command.
  2. In the registry editor, navigate to the following key: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation.
  3. Create a new value with the DWORD type and the name RealTimeIsUniversal.
  4. Double-click the created RealTimeIsUniversal value and set it to 1.
  5. Close the registry editor.
  6. Change the time zone in Windows settings to UTC.
  7. Restart your computer for the changes to take effect.

After these steps, Windows will use UTC instead of local time to display the time in the user interface and in system files. Note that changing the time zone to UTC may affect the operation of some programs, so it is recommended that you consult the developers of the programs you are using before changing the time zone.

Since I’ve started dual booting Linux, I’ve run into a problem… Linux Mint, the distribution I’ve been using, likes to set the BIOS time to UTC. I tried unsuccessfully last time to configure it to not do so, and ended up finding a discussion about simply forcing Windows 10 to do the same so that my clock was not 10 or 11 hours out of whack every time I booted back into Windows.

However, I reinstalled my PC last weekend, and managed to lose that, so I had to dig it up again. This time, after finding the thread on how to get Windows 10 to have the RTC set to UTC, I decided to document it:

Create the a new DWORD value of 1 at the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

That’s it. Then reboot, and all should be right in the world.

Многие новые пользователи, которые только перешли на Linux с операционной системы Windows, и пока все еще запускают эту систему время от времени, сталкиваются с проблемой, что после загрузки Windows в Ubuntu сбивается время на несколько часов назад или вперед, затем после нескольких перезагрузок уже сложно понять какое сейчас время.

Все это происходит из-за различий формата хранения времени в этих операционных системах. И будет происходить при каждой перезагрузке, сколько бы вы ни устанавливали правильное время. Но эту проблему можно решить. И даже несколькими способами. В этой статье мы рассмотрим, как решить проблему сбивается время в Ubuntu и Windows.

Содержание статьи

  • Почему так происходит?
  • Настройка Windows для работы по UTC

  • Настройка Linux для работы localtime

  • Выводы

Почему так происходит?

Как я уже сказал, проблема в разных форматах хранения и восстановления времени. В компьютере есть два вида часов. Аппаратные — идут всегда, даже когда компьютер выключен и программные часы, встроенные в ядро. Когда компьютер включается значение аппаратных часов записывается в программные, и в дальнейшем операционная система берет время оттуда. Но Windows и Linux работают по-разному с этими двумя часами. Есть два способа работы:

  • UTC — и аппаратные, и программные часы идут по Гринвичу. То есть часы дают универсальное время на нулевом часовом поясе. Например, если у вас часовой пояс GMT+3, Киев, то часы будут отставать на три часа. А уже пользователи локально прибавляют к этому времени поправку на часовой пояс, например, плюс +3. Каждый пользователь добавляет нужную ему поправку. Так делается на серверах, чтобы каждый пользователь мог получить правильное для своего часового пояса время.
  • localtime — в этом варианте аппаратные часы тоже идут по Гринвичу, но програмные часы идут по времени локального часового пояса. Для пользователя разницы никакой нет, все равно нужно добавлять поправку на свой часовой пояс. Но при загрузке и синхронизации времени Windows вычитает из аппаратного времени 3 часа (или другую поправку на часовой пояс), чтобы программное время было верным.

Так почему же сбивается время Ubuntu и Windows? Вот, допустим, работает Windows, и со временем там все нормально, оно сохранено в формате localtime. Но при перезагрузке в Linux, операционная система берет время Localtime, и думает что это UTC. Таким образом, пользователь будет брать уже правильное время, и прибавлять к нему поправку на часовой пояс. Поэтому время уже будет неверным.

Дальше вы исправили время, и теперь аппаратные часы работают в UTC. Но затем грузите WIndows. Система думает, что это localtime и для установки правильного программного времени добавляет к аппаратному поправку на часовой пояс, например, в нашем случае +3. Дальше каждый пользователь еще раз применяет эту поправку и время уже сбито, опять.

Единственно верный способ решить эту проблему — заставить обе системы работать по одному формату и сделать это совсем несложно. Причем можно пойти двумя путями: либо заставить Windows работать по UTC, либо Linux по формату localtime, что является не совсем правильным, но вполне возможно. Итак перейдем к решению проблемы сбивается время в Ubuntu.

Настройка Windows для работы по UTC

Итак, если у вас сбивается время Windows и Linux при переключении между операционными системами, лучшим способом будет заставить Windows работать по более правильному и логичному формату. Для этого достаточно добавить один ключ реестра. Вы можете сделать это с помощью одной команды в консоли. Чтобы открыть консоль в Windows 10 проведите мышь в левый нижний угол, затем нажмите правую кнопку. В контекстном меню выберите Командная строка (администратор):

Дальше наберите команду для 32 битных систем:

> Reg add HKLMSYSTEMCurrentControlSetControlTimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1

А для 64-битных, нужно использовать тип значения REG_QWORD:

> Reg add HKLMSYSTEMCurrentControlSetControlTimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1

Почти готово, но служба времени Windows независимо от этой настройки будет писать время в местном формате при обновлении его через интернет, поэтому удобно эту службу отключить. Для этого выполните:

> sc config w32time start= disabled

Как вернуть обратно?

Если вы хотите вернуть все как было, то сделать это можно проще простого. Сначала возвращаем ключ реестра в правильное положение:

> Reg add HKLMSYSTEMCurrentControlSetControlTimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 0

И запускаем обратно службу синхронизации:

> sc config w32time start= demand

Готово, а дальше рассмотрим, как заставить Linux использовать формат времени localtime.

Настройка Linux для работы localtime

По умолчанию Linux использует формат хранения времени UTC, но если Ubuntu сбивает время Windows, вы можете очень просто заставить систему хранить в аппаратном таймере местное время. Во всех дистрибутивах, использующих Systemd, в том числе в Ubuntu для этого достаточно выполнить команду:

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

Чтобы посмотреть текущее состояние аппаратных и программных часов выполните:

sudo timedatectl

Готово, теперь вы можете перезапустить компьютер и запустить Windows, чтобы убедиться, что время не сбивается при перезагрузке. В более старых системах Ubuntu, вам нужно отредактировать файл /etc/default/rcS и заменить UTC=yes на UTC=no. Вы можете сделать это командой:

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

Как вернуть обратно?

Опять же, вернуть все как было можно с помощью одной команды:

sudo timedatectl set-local-rtc 0

А в старых дистрибутивах Ubuntu:

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

Выводы

Вот и все. Теперь, если вы столкнетесь с проблемой Windows 10 — сбивается время Ubuntu или любом другом Linux дистрибутиве, вы уже будете знать, как её решить с помощью двух полностью работающих способов. Если у вас остались вопросы, спрашивайте в комментариях!

Мы разобрались, как настроить правильное время в Ubuntu и Windows, чтобы временные зоны не сбивались, но что такое временные зоны и зачем они нужны, на завершение видео про это:

Windows 10

I’ve written enough about the challenges of Windows devices and the real-time clock that you’ve probably heard this one before:  Windows stores the time in the real-time clock in the local time zone, which causes problems if you install a new OS on the device and it boots up in a different default time zone (usually Pacific).  The OS will assume that the real-time clock is in that time zone.  So let’s say you had an old OS that was installed and configured for Central European Time where the time was 12 pm (noon).  If you install a new Windows 10 OS image, it will boot up and assume that the time is in Pacific time, so in effect the time jumps forward 9 hours.  Eventually, the OS will do a time sync and the time will shift to 3 am, assuming that happens before the time zone is changed.  Then the time zone can get set back to Central European time and it’s again 12 pm.

The problem is the chaos that can cause in the process.  Anything with a timeout (e.g. ESP) can run into issues.  Anything with a “not good before” (e.g. a cert) may not be valid yet.  Anything with a specific scheduled time (e.g. an MDM sync) may be delayed (time hasn’t yet arrived) or skipped (time is already past).  “Results can be unpredictable.”

When doing some reading on UEFI I noticed this quote:

UEFI provides device-independent time services. Time services include support for time zone and daylight saving fields, which allow the hardware real-time clock to be set to local time or UTC.[43] On machines using a PC-AT real-time clock, by default the hardware clock still has to be set to local time for compatibility with BIOS-based Windows,[5] unless using recent versions and an entry in the Windows registry is set to indicate the use of UTC.

That’s good news, for two reasons:  (1) UEFI supports UTC in the real-time clock, and (2) Windows 10 does too, but it needs a registry entry to force that to happen.  Of course the Wikipedia article doesn’t say what that registry key is, but a quick Internet search (finding a bunch of articles related to dual-booting other OSes, since those other OSes assume UTC) points to this value:

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation]
RealTimeIsUniversal=1

Alright, let’s say you make that change in the registry and then reboot.  How do you verify that it did any good?  The first way is to see if the time on the device changed – the registry change doesn’t immediately take effect, so you’ll see a shift in the time (unless your time zone matched UTC).  You can force a sync to get it to change back easily enough.

The next way would be to boot into the UEFI firmware settings for your device.  On a Surface device, reboot and hold down the volume up button, then go to the “Date and Time” option.  That should confirm the device is now in UTC (assuming it was properly set for whatever time zone the OS was configured to use after the reboot after the registry key was set).

OK, so what about a virtual machine?  In Hyper-V, the Hyper-V integration services will keep the time in sync between the host and the guest VM.  Will that respect the UTC setting?  From my limited testing (my home Hyper-V server is a pale comparison to what I used to have in the office), yes, it does appear that this works fine, which makes sense as the Hyper-V integration services frequently sync the time between host and guest and people would complain if that didn’t handle differences in time zones between host and guest.  (It just proves that Hyper-V isn’t adjusting the real-time clock directly, but is instead doing it via the integration services.)

Another interesting twist:  This is apparently something that Azure ran into as well, so when you upload a VHDX to be used as the base for new IaaS VMs, you need to follow the documentation to set the same thing:

Set Coordinated Universal Time (UTC) time for Windows. Also, set the startup type of the Windows time service w32time to Automatic:

Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation -Name RealTimeIsUniversal -Value 1 -Type DWord -Force
Set-Service -Name w32time -StartupType Automatic

And if you’re an AWS user, they’ve also documented it here.

If you are using a Mac (which always uses UTC in the real-time clock), it sounds like BootCamp will take care of this for you (well, as long as BootCamp continues to exist – seems like that would be challenging with an ARM-based Mac).  Other virtualization software may or may not handle this, so test it out yourself.

Now we just need to get the industry to make a few changes:

  • Windows should set the RealTimeIsUniversal registry value as a default; that should also be done for Windows PE.
  • Manufacturers should ship their devices with the firmware time pre-set to the correct UTC time.  (If they set the time from within Windows where the registry is set, that would just happen.)

Someone with some pull should make those requests…

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Стандартный firewall windows 10
  • Windows kb2670838 что это
  • Windows 10 matros edition 2018
  • Можно ли обновить windows 7 максимальная
  • Windows server 2016 контроллер домена системные требования