The other day I got a client asking for help syncing time across all Windows 10 thin clients with their NTP server. After taking a walk around NYC and witnessing many hanging shoes I refreshed my head I found a useful way to check Windows NTP configuration using the command prompt.
Using w32tm To Check and configure NTP using the Command Prompt
In Windows 10 open your command prompt and type the below command to check your current NTP configuration:
w32tm /query /configuration
The above gives you the current time configuration.
w32tm /query /status
The above shows you many more details, such as: stratum, precision, last sync, NTP server and etc..
time /T
This last one shows the current time.
At some Windows10 machines I got the below error:
The following error occurred: The service has not been started. (0x80070426)
This means the time service has is not running or disabled. I made sure to enabled accordingly either using the command prompt:
net start w32time
or at the services window when the above did not work:
There’s also a way to set and start Windows NTP configuration using the command prompt this way:
w32tm /config /manualpeerlist:10.0.0.5 /syncfromflags:manual /reliable:yes /update
Then, as usual Windows stays problematic. I had to run the below commands in sequence:
w32tm /unregister
w32tm /register
net start w32time
I did all these because I found out by running:
net time /querysntp
I got the deprecated error:
The /QUERYSNTP and /SETSNTP options have been deprecated. Please use w32tm.exe to configure the Windows Time Service.
At the end of the config you might need to run:
w32tm /config /update
w32tm /resync /rediscover
To make Windows 10 rediscover its NTP settings. Play around, research the official Windows documentation. You can also place all these command on a batch file and deploy it to all your clients.
Good luck! Contact me if you have any questions. Remember to check out my IT Handyman shop for cool T-Shirts and coffee mugs I designed once in a while.
Вы можете столкнуться с ошибкой синхронизации времени в Windows, когда ваш компьютер не может автоматически синхронизировать свое время с серверами времени time.microsoft.com в Интернете. Из-за некорректного времени на компьютере у вас может возникать ошибка «
Your clock is ahead/ Ваши Часы спешат (отстают)
» при открытии HTTPS сайтов Chrome (и в других браузерах), не корректно работать сторонние программы, и появляться различные другие неприятности.
Если попытаться вручную выполнить синхронизацию времени из панели управления Windows (Control Panel -> Date and Time -> Internet Time -> Change Settings -> Update now), появляется ошибка:
An error occurred while windows was synchronizing with time.windows.com. The peer is unreachable.
Также здесь может быть ошибка:
The peer is unresolved.
Проверьте, что у вас настроена автоматическая синхронизация времени с NTP серверами в Интернете. Перейдите в раздел Settings -> Time and Language -> Date and Time (можно перейти в этот раздел с помощью команды быстрого доступа по URI:
ms-settings:dateandtime
). Проверьте, что здесь включена опцию Set time automatically и выполните синхронизацию, нажав кнопку Sync now в разделе Additional settings.
Если синхронизация времени с Интернетом не работает, проверьте, с какого внешнего NTP сервера должен получить время ваш компьютер. Выполните команду:
w32tm /query /peers
По умолчанию компьютеры в рабочих группах (не присоединенные к домену Active Directory) настроены на получение времени с серверов time.windows.com.
Если при запуске этой команды появилась ошибка “The following error occurred: The service has not been started. (0x80070426)”, проверьте состояние службы Windows Time. Она должна быть настроена на автоматический или ручной запуск. Можете проверить состояние службы с помощью PowerShell или консоли services.msc:
Get-Service w32time| Select DisplayName,Status, ServiceName,StartType
Перезапустите службу:
Restart-Service -Name w32time
Если служба отключена, включите ее.
Проверьте, что с вашего компьютера доступен хост time.microsoft.com.
Сначала проверьте, что ваш компьютер может разрешить это имя в IP адрес:
nslookup time.windows.com
Если ваш компьютер не может отрезолвить это имя в IP адрес (ошибка синхронизации времени The peer is unresolved), значит в настройках сетевого адаптера вашего компьютера указан DNS сервер, который не доступен, или изолирован от интернета. Попробуйте сменить адрес первичного DNS сервера на DNS сервер Google (8.8.8.8). Можно изменить настройки DNS для сетевого адаптера в Windows с помощью PowerShell.
Вывести список сетевых интерфейсов:
Get-NetAdapter
Изменить настройки DNS для сетевого адаптера с ifIndex 10:
Set-DNSClientServerAddress –InterfaceIndex 10 –ServerAddresses 8.8.8.8
Проверьте доступность сервера с помощью ping:
ping time.windows.com
И затем проверьте, что сервер времени Microsoft доступен по порту NTP (UDP 123). Для проверки доступности UDP порта можно использовать утилиту portquery или можно напрямую обратиться к серверу и запросить у него текущее время:
w32tm /stripchart /computer:time.windows.com
Если команда вернет ошибку error: 0x800705B4, значить указанный NTP сервер не доступен. Проверьте, что в Windows открыт исходящий порт UDP/123 для протокола NTP (по умолчанию порт должен быть открыт). Вы можете принудительно открыть порт в Windows Defender Firewall с помощью PowerShell:
New-NetFirewallRule -DisplayName "AllowOutNTP" -Direction Outbound -Protocol UDP -RemotePort 123 -Action Allow
Enable-NetFirewallRule -DisplayName AllowOutNTP
Также убедитесь, что исходящий NTP трафик не блокируется на сетевом уровне (провайдера, вашего файервола или другими сетевыми устройствами).
Если этот NTP сервер не доступен, вы можете использовать другой NTP сервер.
Можно указать
time.nist.gov
или ближайший к вам NTP сервер, который можно получить на сайте
https://www.ntppool.org
.
Можно изменить адрес вашего NTP сервера с помощью командной строки:
w32tm /config /manualpeerlist:time.nist.gov,0x1 /syncfromflags:manual /reliable:yes /update
Перезапустите службу времени (в данном примере вы запустим несколько команд в одну строку):
net stop w32time && net start w32time
Затем выполните синхронизацию времени:
w32tm /config /update
w32tm /resync
Проверьте, что ваш компьютер успешно получил время с нового источника времени (NTP сервера):
w32tm /query /status
Если ничего не помогло, попробуйте полностью сбросить настройки службы Windows Time:
net stop w32time
w32tm /unregister
w32tm /register
net start w32time
Выполните синхронизацию времени:
w32tm /resync
Также вы можете добавить NTP сервер в список серверов времени и выполнить синхронизацию из панели управления Windows. Перейдите в Settings -> Time & language -> Date & time -> Additional clocks –> Internet Time
Убедитесь, что включена опцию Synchronize with an Internet time, добавьте новый сервер time.nist.gov и нажмите кнопку Update Now.
Вы можете добавить NTP сервера в этот список через реестр HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers.
Для автоматической синхронизации времени в Windows используется отдельно задание в планировщике Task Scheduler. Запустите консоль taskschd.msc и перейдите в раздел Task Scheduler (Local) -> Task Scheduler Library -> Microsoft -> Windows -> Time Synchronization. Проверьте, что задание SynchronizeTime включено.
Также вы можете проверить состояние задания Task Scheduler с помощью PowerShell:
Get-ScheduledTask SynchronizeTime
Чтобы включить его:
Get-ScheduledTask SynchronizeTime|Enable-ScheduledTask
,
If Windows 10 not syncing time or displays wrong time, continue reading below to fix the problem. You may have noticed that your computer doesn’t sync to the time of your new location after moving to a new country. Your computer may also not sync to the correct time every time you restart the device, and you should always manually update the date and time on every restart.
The time synchronization problems usually occurs when the Windows Time service is disabled or when Windows fails to synchronize the time with the Internet time server, with error: «An error occurred while Windows was synchronizing with time.nist.com. This operation returned because the timeout period expired.».
In this guide you’ll find several methods to fix time syncing issues in Windows 11/10/8 or 7 OS.
How to FIX: Windows 10/11 Time Not Syncing – Time Synchronization Failed.
- Enable the Time Synchronization task.
- Start or Restart the Time service.
- Reregister Windows Time Service & Resync Time.
- Change the Internet Time server.
Method 1: FIX Windows Not Syncing Time issue by Enabling the SynchronizeTime task.
The first troubleshooting step to fix the time-syncing issues is to check if the time synchronization feature is enabled in task scheduler.
1. Simultaneously press the Windows + R keys to open Run command box.
2. Type taskschd.msc then click OK to open Task Scheduler.
3. On the left pane in task scheduler, expand Task Scheduler Library -> Microsoft .> Windows.
4. Under Windows, scroll down and select Time Synchronization.
5. In the right pane, under the Name column, right-click at SynchronizeTime and click Enable.
6. Close the task scheduler, then check if the time on the device is syncing. If the problem persists, continue to method-2 below.
Method 2: Start/Restart the Windows Time service.
Once the time synchronization task is enabled, proceed to start the Windows Time service (or to restart it if already started).
1. Press the Windows + R keys to open Run command box.
2. Type services.msc and click OK to launch Services.
3. Locate Windows Time among the services, if it is running, right-click and Restart the service. However, if it is stopped, right-click and select Start.
4. Now check if the time is automatically synced.
Method 3. Reregister Windows Time Service and Resync Time using Command Prompt.
When Windows 10 is not syncing time, we can use command prompt to re-register the Time Service and then resync time.
1. In the Search box type cmd or command prompt and select Run as Administrator.
2. Type the commands below to unregister the time service by removing its configuration information from the registry and then to resynchronize the time.
- net stop w32time
- w32tm /unregister
- w32tm /register
- net start w32time
- w32tm /resync /nowait
3. Once all commands are executed, restart the computer. Your time will be accurately synchronized.
Method 4: Use Another Internet Time Server.
Another method to solve time synchronization problems in Windows 10, is to change the Internet time server to which Windows is connected to synchronize the computer’s time.
1. Press the Windows + R keys to open Run command box.
2. Type control date/time and click OK to open the «Date and Time» settings.
3. At Date and Tine window, ensure that you have specified the correct Time Zone.
4. Then select the Internet Time tab and click Change Settings.
5. Ensure that Synchronize with an Internet time server is checked. Then, click on the dropdown and change the time Server. When done, click Update now.
6. Once it updates, the time on your device will synchronize correctly with the time of the region where you are based. *
* Note: If, after following the above methods, your computer loses time after shutdown, this indicates a faulty CMOS battery. In such a case, replace the CMOS battery in the device.
That’s it! Which method worked for you?
Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.
If this article was useful for you, please consider supporting us by making a donation. Even $1 can a make a huge difference for us in our effort to continue to help others while keeping this site free:
- Author
- Recent Posts
Konstantinos is the founder and administrator of Wintips.org. Since 1995 he works and provides IT support as a computer and network expert to individuals and large companies. He is specialized in solving problems related to Windows or other Microsoft products (Windows Server, Office, Microsoft 365, etc.).
Force Time Sync
-
Press Win + I (Open Settings)
-
Go to Time & Language > Date & Time
-
Turn off Set time automatically
-
Allow a short pause (Wait 30 Seconds)
-
Toggle On Automatic Time
-
Click Sync now under Additional settings
-
Check if the time updates correctly (Verify Time)
If it fails, repeat the process 2-3 times. Sometimes Windows needs a few attempts .
Verify Time Zone
-
Go to Settings > Time & Language > Date & Time
-
Ensure the Time zone matches your location
-
Click Get a recommended time zone
-
Turn on Set time zone automatically (Toggle Automatic Time Zone)
If you’re near a border, test neighboring time zones
Restart Windows Time Service
-
Press Win + X and select Windows Terminal (Admin) (Open Terminal)
-
Run net stop w32time (Stop Time Service)
-
Run net stop w32time (Stop Time Service)
-
Run net stop w32time (Stop Time Service)
-
Run net stop w32time (Stop Time Service)
-
Run net stop w32time (Stop Time Service)
If errors occur, restart your PC and try the commands again.
Update Time Server
-
Right-click the clock, select Adjust date and time (Adjust Date & Time)
-
Click Additional date, time, & regional settings > Set the time and date (Access Internet Time Settings)
-
Try servers: time.windows.com, time.nist.gov, pool.ntp.org (Select Server)
-
Click Update now (Update Time)
If one server fails, try the others.
Check for Windows Updates
-
Go to Settings > Windows Update > Check for updates
-
Click Download & install
-
Restart after installation
-
Check if the time sync is resolved (Verify Time)
Keep Windows updated to prevent sync issues.
Ошибка синхронизации времени в Windows может вызывать проблемы с доступом к HTTPS-сайтам, работой программ и другими неполадками. Например, браузеры могут выдавать ошибку «Your clock is ahead» или «Your clock is behind». В этой статье расскажем, как устранить ошибки синхронизации времени с NTP-серверами (например, time.windows.com) с помощью PowerShell, проверки сети и настройки службы w32time.
Приобрести оригинальные ключи активации Windows 10 можно у нас в каталоге от 1490 ₽
Проверка автоматической синхронизации времени
1. Проверьте настройки времени:
– Откройте Параметры → Время и язык → Дата и время (ms-settings:dateandtime).
– Убедитесь, что включена опция Установить время автоматически (Set time automatically).
– Нажмите Синхронизировать (Sync now) в разделе Дополнительные настройки.
2. Проверьте источник времени:
w32tm /query /peers
– По умолчанию: time.windows.com (для компьютеров в рабочей группе).
Диагностика службы Windows Time
1. Проверьте состояние службы w32time:
Get-Service w32time | Select DisplayName, Status, ServiceName, StartType
– Служба должна быть Запущена (Running) и иметь тип запуска Автоматический или Ручной.
2. Перезапустите службу:
Restart-Service -Name w32time
3. Включите службу, если отключена:
Set-Service -Name w32time -StartupType Automatic
Start-Service -Name w32time
Проверка сетевой доступности NTP-сервера
1. Проверьте разрешение имени:
nslookup time.windows.com
– Если ошибка «The peer is unresolved», DNS-сервер недоступен или изолирован.
2. Смените DNS на Google:
– Выведите сетевые интерфейсы:
Get-NetAdapter
– Установите DNS (ifIndex — номер интерфейса, например, 10):
Set-DNSClientServerAddress -InterfaceIndex 10 -ServerAddresses 8.8.8.8
3. Проверьте доступность сервера:
ping time.windows.com
4. Проверьте порт NTP (UDP 123):
w32tm /stripchart /computer:time.windows.com
– Ошибка 0x800705B4 указывает на недоступность сервера.
5. Откройте порт UDP 123 в Windows Defender Firewall:
New-NetFirewallRule -DisplayName "AllowOutNTP" -Direction Outbound -Protocol UDP -RemotePort 123 -Action Allow
Enable-NetFirewallRule -DisplayName AllowOutNTP
6. Проверьте сетевые ограничения:
– Убедитесь, что UDP 123 не блокируется провайдером, файрволом или роутером.
Смена NTP-сервера
Если time.windows.com недоступен, используйте другой сервер, например, time.nist.gov или серверы из ntppool.org.
1. Настройте новый NTP-сервер:
w32tm /config /manualpeerlist:time.nist.gov,0x1 /syncfromflags:manual /reliable:yes /update
2. Перезапустите службу:
net stop w32time && net start w32time
3. Выполните синхронизацию:
w32tm /config /update
w32tm /resync
4. Проверьте статус:
w32tm /query /status
Сброс настроек службы времени
Если синхронизация не работает, сбросьте настройки w32time:
net stop w32time
w32tm /unregister
w32tm /register
net start w32time
w32tm /resync
Настройка через графический интерфейс
1. Откройте Параметры → Время и язык → Дата и время → Дополнительные часы → Время Интернета.
2. Убедитесь, что включена Синхронизация с сервером времени в Интернете.
3. Добавьте time.nist.gov → Обновить сейчас (Update Now).
Настройка через реестр
Добавьте NTP-сервер в реестр:
– Путь: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers.
– Создайте строковый параметр (например, 2) со значением time.nist.gov.
Проверка задания в планировщике задач
1. Откройте Планировщик задач (taskschd.msc).
2. Перейдите в Библиотека планировщика задач → Microsoft → Windows → Time Synchronization.
3. Убедитесь, что задание SynchronizeTime включено.
4. Через PowerShell:
Get-ScheduledTask SynchronizeTime
Get-ScheduledTask SynchronizeTime | Enable-ScheduledTask
Рекомендации
– Безопасность: Используйте надёжные NTP-серверы (time.nist.gov, pool.ntp.org).
– Мониторинг: Проверяйте логи в Event Viewer (System, события w32time):
Get-WinEvent -LogName System | Where-Object {$_.ProviderName -eq "Microsoft-Windows-Time-Service"}
– Автоматизация: Настройте скрипт для проверки синхронизации:
$status = w32tm /query /status
if ($status -notlike "*Synchronized*") { w32tm /resync; Write-Output "Time resynced" }
– Резервное копирование: Сохраняйте настройки реестра перед изменением:
reg export HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers C:\PS\ntp.reg
Ошибки синхронизации времени в Windows устраняются проверкой службы w32time, DNS, порта UDP 123 и настройкой NTP-серверов. PowerShell упрощает диагностику и настройку, позволяя быстро сменить сервер, открыть порт или сбросить настройки. Правильная синхронизация времени критически важна для стабильной работы приложений и безопасности соединений.