Чтобы на вашем устройстве Windows показывалось правильное время, часовой пояс (time zone) на нем должен соответствовать географическому расположению компьютера. В этой статье мы рассмотрим, как задать часовой пояс в Windows из панели управления, из командной стоки, PowerShell и через групповые политики.
Содержание:
- Настройка часового пояса через панель управления Windows
- Изменить часовой пояс из командной строки с помощью TZutil
- Управление часовым поясом в Windows из PowerShell
- Настройка часового пояса Windows через GPO
Настройка часового пояса через панель управления Windows
Начиная с Windows 10 и Windows Server 2016 для настройки времени часового пояса в Windows используется отдельный раздел в панели Параметры/Settings. Выполните команду
ms-settings:dateandtime
или щелкните по значку часов в системном трее и выберите пункт Adjust date/time (Настройка времени и даты).
По умолчанию Windows пытается автоматически синхронизировать время и выбрать часовой пояс (включена опция Set time zone automatically/Автоматически устанавливать часовой пояс).
Чтобы выбрать часовой пояс вручную, нужно отключить эту опцию и выбрать пояс в выпадающем списке.
Также для управления часовым поясом можно использовать классическое окно настройки времени в Windows (команда
timedate.cpl
).
При попытке изменить часовой пояс в Windows Server 2019 и 2022 под администратором из панели управления появляется ошибка:
Date and time Unable to continue. You do not have permission to perform this task. Please contact your computer administrator for help.
Продолжение невозможно. У вас нет разрешения на выполнение этой задачи. Обратитесь за помощью к сетевому администратору.
Чтобы решить эту проблему, проверьте что у вашей учетной записи есть права на смену часового пояса. Откройте редактор локальной групповой политики (
gpedit.msc
), перейти в раздел Computer Configuration -> Windows Settings -> Security Settings -> Local Policiers -> User Rights Assignment и добавить встроенную группу Administrators в параметр Change the time zone.
После обновления настроек GPO запустите командную строку с правами администратора (!!!), выполните команду
timedate.cpl
и вы сможете изменить часовой пояс. Либо в качестве обходного решения вы можете изменить часовой пояс из командной строки.
Изменить часовой пояс из командной строки с помощью TZutil
Для управления часовым поясом в Windows можно использовать встроенную утилиту
tzutil.exe
(Windows Time Zone Utility).
Вывести идентификатор текущего часового пояса (TimeZoneID):
tzutil /g
Russian Standard Time
Выведите список всех часовых поясов с их параметрами и названиями:
tzutil /l
Если вам нужно быстро найти вывести все часовые пояса, с определенным с сдвигом, например UTC +2, выполните команду:
tzutil /l | find /I "utc+02"
Чтобы изменить текущий часовой часовой пояс (UTC+03:00) Москва, Санкт-Петербург, Волгоград – (Russian Standard Time) на (UTC+04:00) Ижевск, Самара (Russia Time Zone 3), выполните команду:
tzutil /s "Russia Time Zone 3"
Текущий часовой пояс хранится в следующей ветке реестра:
reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Если в часовом поясе предусмотрен переход на летнее время, его можно отключить. Для этого нужно указать идентификатор часового пояса с суффиксом _dstoff:
tzutil /s "Pacific Standard Time_dstoff"
Эта команда изменит часовой пояс компьютера и отключите сезонный перевод часов.
Настройки часового пояса и сезонного перевод часов можно вывести так:
w32tm /tz
Часовой пояс: Текущий:TIME_ZONE_ID_UNKNOWN Сдвиг: -180мин (UTC=LocalTime+Bias)
[Зимнее время:"RTZ 2 (зима)" Сдвиг:0мин Дата:(не указано)]
[Летнее время:"RTZ 2 (лето)" Сдвиг:-60мин Дата:(не указано)]
Управление часовым поясом в Windows из PowerShell
Чтобы узнать текущий часовой пояс Windows из PowerShell, выполните команду:
Get-TimeZone
Id : Ekaterinburg Standard Time DisplayName : (UTC+05:00) Екатеринбург StandardName : RTZ 4 (зима) DaylightName : RTZ 4 (лето) BaseUtcOffset : 05:00:00 SupportsDaylightSavingTime : True
Вывести доступные часовые пояса:
Get-TimeZone -ListAvailable
Для поиска в списке часовых поясов воспользуйтесь фильтром:
Get-TimeZone -ListAvailable | Where-Object {$_.displayname -like "*Samara*"}
Изменить часовой пояс:
Set-TimeZone -Name "Astrakhan Standard Time"
Или
Get-TimeZone -ListAvailable|? DisplayName -like "*Moscow*"|Set-TimeZone
Удаленно получить список часовых поясов на серверах Windows (список в txt файле):
$servers = get-content C:\servers.txt
Get-WMIObject -Class Win32_TimeZone -Computer $servers | select-Object PSComputerName, Caption
Изменить часовой пояс на списке серверов Windows:
$servers = get-content C:\servers.txt
Invoke-Command -ComputerName $servers -Command {Set-TimeZone "West Asia Standard Time"}
В этих примерах используется версия PowerShell 5.1, но они также работают и в более новых версиях.
Настройка часового пояса Windows через GPO
Для централизованной настройки часового пояса на компьютерах в домене Active Directory вы можете использовать групповые политики. Готовой политики для настройки часового пояса в GPO нет. Чаще всего используются следующие два варианта настройки часового пояса через GPO: с помощью logon скрипта GPO и с помощью импорта настроек часового пояса в реестр.
Для задания часового пояса через логон скрипт GPO, можете использовать простейший PowerShell скрипт (подходит для всех версий Windows):
$tmZone = "Russian Standard Time"
$WinOSVerReg = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
$WinOSVer = $WinOSVerReg.GetValue("CurrentVersion")
if ($WinOSVer -GE 6){
tzutil.exe /s $tmZone
} Else {
$param = "/c Start `"Change tmZone`" /MIN %WINDIR%\System32\Control.exe TIMEDATE.CPL,,/Z "
$param += $tmZone
$proc = [System.Diagnostics.Process]::Start( "CMD.exe", $param )
}
Другой способ настроек времени заключается в импорте содержимого ветки HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation с эталонного компьютера с настроенным временем на другие компьютеры через GPO. Процедура импорта ветки реестра через Group Policy Preferences описана в этой статье.
Выберите эту ветку целиком с помощью Registry Browser. В результате все настройки временной зоны будут импортированы в раздел редактора GPO (Computer Configuration -> Preferences -> Windows Settings -> Registry).
Если вы хотите использовать разные настройки временных зон для разных сайтов Acrive Directory, воспользуйтесь GPP Item Level Targeting. Привяжите настройки часового пояса к нужному сайту.
Если вы используете терминальные фермы RDS серверов, и пользователи и сервера RDSH находятся в разных часовых поясах, то в RDP сессий у пользователя будет отображаться некорректное время. Чтобы перенаправить локальный часовой пояс пользователя в RDP сессию, включите параметр GPO Allow time zone redirection (Computer Configuration > Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Device and Resource Redirection.
Command-line time zone adjustment in Windows 10 and 11 is useful for remote administration and setting the time zone from scripts. The following offers step-by-step instructions on how to change the time zone in CMD for Windows 10 and Windows 11, also using the system Settings app.
Displaying the current time zone from the command prompt
The tzutil command is used to manage the time zone on your Windows 10 or Windows 11 computer. To run this command, open the command prompt by right-clicking on the Start menu and selecting Command Prompt (if running Windows 10), or Terminal (if running Windows 11).
Then, to display the currently set time zone from the command prompt, enter the following command:
tzutil /g
The /g parameter tells tzutil to list only the currently set time zone.
Centrally manage endpoints with NinjaOne.
→ Learn more.
Edit time zone Windows 10 and Windows 11: Step-by-step instructions
By default, tzutil doesn’t require any administrative privileges to change the time zone. If you’re in an environment where permissions have been changed so that you do need to be an administrator, open the command prompt as an administrator by right-clicking on the Start menu and then clicking Command Prompt (admin) if you’re on Windows 10, or Terminal (Admin) if you’re running Windows 11.
To edit the time zone you’ll need to know the exact name of the time zone to enter (for example, “Pacific Standard Time”). Enter the following command to list all time zones:
tzutil /l
The /l parameter tells tzutil to list all time zones.
You can then locate the time zone you want to change to in the list and use tzutil to change to it by using its name exactly as it is formatted there:
tzutil /s “Pacific Standard Time”
You can then verify the change by running:
tzutil /g
Change time zone CMD examples
Here are a few examples of changing the time zone for different locations from the Windows 10 and Windows 11 CMD prompt:
tzutil /s “AUS Eastern Standard Time”
This will set the correct time zone for Eastern Australia (including Canberra, Melbourne, and Sydney).
tzutil /s “Singapore Standard Time”
This will set the time zone used in both Kuala Lumpur, Malaysia, and in Singapore.
tzutil /s “UTC”
And this will set the time to Coordinated Universal Time.
Changing time zone with PowerShell
The Get-TimeZone and Set-TimeZone cmdlets can be used in PowerShell to view, list, and change time zones on Windows.
To open PowerShell, right-click on the Start menu and click Windows PowerShell (Admin) in Windows 10 or Terminal (Admin) in Windows 11.
Then, enter the following command to view the currently set time zone:
Get-TimeZone
To list all available time zones so that you can find the correct name to set, enter:
Get-TimeZone -ListAvailable
Then change your currently set time zone using Set-TimeZone and the name from the list generated by Get-TimeZone:
Set-TimeZone -Name “Hawaiian Standard Time”
Change time zone PowerShell examples
Below are some more examples of changing the time zone using Set-TimeZone in PowerShell on Windows 10 and Windows 11:
To change the Windows time zone for Osaka, Sapporo, and Tokyo:
Set-TimeZone -Name “Tokyo Standard Time”
To change the system time zone to Greenwich Mean Time for Dublin, Edinburgh, Lisbon, and London:
Set-TimeZone -Name “GMT Standard Time”
To set the time zone for Central Time (US & Canada):
Set-TimeZone -Name “Central Standard Time”
Changing time zone from the Settings interface
While some find it more convenient to set the time zone using the command prompt or PowerShell, you can still fall back to the Settings app if you make a mistake:
- Right-click on the start menu and open Settings.
- Click on Time and Language in the menu to the left.
- Click Date and time in the menu to the right.
- Change the Time zone entry to the desired time zone.
You also have the option to enable Set time zone automatically, and your computer will use location services to determine the correct time zone for your current location.
Windows change time zone troubleshooting FAQs
If you cannot set the time zone, first check whether you need to be running CMD or PowerShell as an administrator. Then, make sure you’re spelling it exactly as it appears in the list from tzutil /l or Get-TimeZone -ListAvailable. You can automate changing the time zone by adding the commands above to your batch and PowerShell scripts, for example, to add shortcuts to your desktop to change time zones if you frequently travel between two locations.
Implications of an incorrectly set time zone
Setting the time zone (and system clock) incorrectly has two main implications: firstly, you’ll think it’s the wrong time. You may also switch to daylight savings times not appropriate for your region, further throwing you off when scheduling meetings or speaking with others.
Secondly, secure connections using SSL, including those websites using HTTPS, will fail if the time is not set correctly for the selected time zone.
NinjaOne gives you full visibility into the health and performance of your Active Directory Domain Controllers.
Click here to learn more.
Managing the time zone configuration for multiple devices
Managing the time zone for multiple Windows 10 or Windows 11 devices that are spread across regional offices can become difficult for work-from-home users or for traveling staff members. Policies can be set in Active Directory to allow users to manage their own time zones, which allows them to troubleshoot their own time zone issues without impacting others.
In Windows environments that don’t use a Domain, you can use remote monitoring and management (RMM) to configure and enforce time zone policies for devices.
Time zone setting allows us to set the time according to the geographical location the computer is located at. We can change the time zone of a computer in Date and Time properties window which can be opened by running timedate.cpl from Run window.
Few readers of the blog have put this question to me. Is it possible to set the time zone from command line?
The answer varies depending on which Windows edition you have. In Windows 7, we have a command called tzutil using which we can easily change time zone from windows command line. In Windows XP, it’s bit complicated.
Windows 7
You can run the below command to set timezone in Windows 7.
tzutil /s "Time zone Identifier"
Examples:
Command to set time zone to Pacific Standard Time:
tzutil /s "Pacific Standard Time"
Command to set time zone to Central America standard time:
tzutil /s "Central America Standard Time"
Get the current time zone
We can find the current time zone by running the following command.
tzutil /g
Example:
c:\>tzutil /g Pacific Standard Time c:\>
Get the list of time zones
Run the command ‘tzutil /l‘ to get the list of time zones available.
Windows XP/Server 2003
While searching for a solution to this problem I got to know that there is a Windows Resource kit tool called timezone.exe which can be used to change day light savings..It does not set time zone. I tried further to find if there is any registry hack and below is what I came up with.
I found that the below registry key stores the information about different time zones.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
There is another registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation which has information about the current time zone. This registry has the following information on my computer.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Bias REG_DWORD 0x1e0
StandardName REG_SZ Pacific Standard Time
StandardBias REG_DWORD 0x0
StandardStart REG_BINARY 00000B00010002000000000000000000
DaylightName REG_SZ Pacific Daylight Time
DaylightBias REG_DWORD 0xffffffc4
DaylightStart REG_BINARY 00000300020002000000000000000000
ActiveTimeBias REG_DWORD 0x1e0
Now it’s clear that in order to change the time zone we need to put right data in these registry values.
Now the question is how to get these values for the time zone you want to set? It’s very simple. You just need to set the time to your desired time zone using GUI (timedate.cpl) and then capture the registry values by exporting the registry key TimeZoneInformation to a reg file. Whenever you want to set the time zone from command line just run the exported .reg file and then reboot the machine to make the changes effective. You can run the .reg command from a batch file also.
The above method works for all Windows versions – XP, Windows 7, Server 2003 and Server 2008.
There’s another method in circulation for setting time zone from command prompt.
RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central Standard Time
When I had tested the command on XP, I found that it does not work for all the timezones. In Windows 7, it does not work at all. It just opens the time and date configuration window.
Часовой пояс или временная зона (Time zone) является одним из важных системных параметров, необходимых для корректной работы операционной системы. Неправильно установленный часовой пояс может привести к проблемам в работе программ и самой ОС, поэтому его значение должно строго соответствовать географическому расположению компьютера.
Изменять часовой пояс приходится нечасто, как правило после установки ОС в этом нет необходимости. Но иногда бывают экстренные ситуации, например неожиданная отмена перехода на летнее\зимнее время и, как следствие, массовая смена часовых поясов. В этом случае нас может спасти командная строка. В Windows есть пара способов изменения часового пояса из командной строки, которые мы и рассмотрим.
Утилита TZUtil
Утилита командной строки TZUtil (Windows Time Zone Utility) специально предназначена для изменения часового пояса в операционных системах Windows. Впервые она появилась в Windows Vista\Server 2008 в качестве отдельного обновления, а начиная с Windows 7\Server 2008 R2 входит в состав операционной системы. Исполняемый файл утилиты tzutil.exe хранится в каталоге %WINDIR%\System32.
Синтаксис у tzutil довольно простой. Для вывода справки воспользуемся командой:
tzutil /?
Просмотреть текущий часовой пояс можно командой:
tzutil /g
А для вывода списка всех часовых поясов надо выполнить:
tzutil /l
Для примера изменим текущий часовой пояс с Московского на Ижевский — (UTC+04:00) Ижевск, Самара (Russia Time Zone 3). Для этого выполним команду:
tzutil /s "Russia Time Zone 3"
Примечание. Для отключения перехода на летнее время при установке часового пояса необходимо к названию часового пояса добавлять суффикс _dstoff, например:
tzutil /s “Pacific Standard Time_dstoff”
В связи с отменой перехода на летнее время это не очень актуально, но кто знает 🙂
Кстати, утилита w32tm с ключом /tz также умеет показывать текущий часовой пояс:
w32tm /tz
PowerShell
Начиная с PowerShell версии 5.1 управлять часовыми поясами можно с помощью специальных командлетов Get-TimeZone и Set-TimeZone. Первый предназначен для просмотра информации о часовых поясах, второй соответственно для их изменения. Для того, чтобы посмотреть текущий пояс, надо просто выполнить команду:
Get-TimeZone
А так можно вывести весь список:
Get-TimeZone -ListAvailable
Теперь вернем обратно часовой пояс (UTC+03:00) Москва, Санкт-Петербург, Волгоград (Russian Standard Time):
Set-TimeZone -Id "Russian Standard Time"
Еще для получения информации о часовых поясах можно воспользоваться статическими .Net классами System.TimeZoneInfo и System.TimeZone. Например посмотреть текущий пояс можно так:
[System.TimeZoneInfo]::Local
или так:
[System.TimeZone]::CurrentTimeZone
А список часовых поясов можно вывести таким способом:
[System.TimeZoneInfo]::GetSystemTimeZones()
Отметим, что часовой пояс, как и дата/время, является одним из значимых параметров компьютера, влияющих на правильное функционирование Windows и различных приложений. Рекомендуется устанавливать часовой пояс в соответствии с географическим положением компьютера.
Предоставление прав на изменение часового пояса в Windows.
Чтобы ограничить права пользователей на изменение часового пояса, необходимо открыть локальную политику безопасности через командную строку с помощью команды: secpol.msc В открывшемся окне перейдите по пути: Security Settings -> Local Policy -> User Rights Assignment -> Change the time zone (Изменение часового пояса).
Чтобы ограничить права пользователей на изменение часового пояса, необходимо удалить ‘Users’ из списка учетных записей пользователей. В Windows Server изменять часовой пояс могут пользователи из групп ‘Local Service’ и ‘Administrators’.
Изменение часового пояса в Windows / Windows Server.
Изменение часового пояса в графическом интерфейсе Windows
В операционных системах Windows 10 и Windows Server 2019/2016 для настройки времени и часового пояса можно:
— перейти в раздел «Настройки» через меню «Пуск»;
— перейти в раздел «Параметры», щелкнув правой кнопкой мыши по значку часов на панели задач, где можно выбрать опцию «Настроить дату и время»;
*Поумолчанию опция «Устанавливать время автоматически» будет отмечена. Вы можете отключить эту опцию и вручную выбрать нужный часовой пояс из выпадающего списка.
— Запустите timedate.cpl из cmd, и он откроет окно настроек времени Windows, где вы можете указать часовой пояс с помощью кнопки «Изменить часовой пояс».
Изменение часового пояса из cmd с помощью утилиты TZUtil
Откройте командную строку cmd.exe
* Отметим, что утилита tzutil.exe подходит для Windows 10/11, Windows Server 2016/2019/2022
Сначала определите текущий часовой пояс и его идентификатор (TimeZoneID). Для этого введите команду:
tzutil /g
Если вы не уверены в точном названии нужного часового пояса, выведите список всех часовых поясов с их названиями и идентификаторами с помощью следующей команды:
tzutil /l
Вы также можете найти актуальный список часовых поясов Windows у Microsoft.
Чтобы изменить текущий часовой пояс, укажите идентификатор нового часового пояса в следующем формате:
tzutil /s "GTB Standard Time"
В реестре Windows можно проверить текущий часовой пояс:
reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Чтобы отключить переход на летнее время для определенной зоны, необходимо указать идентификатор часового пояса с окончанием: _dstoff
tzutil /s "GTB Standard Time_dstoff"
Чтобы отобразить полную информацию о часовом поясе и настройках сезонных часов, введите следующую команду :
w32tm /tz
Изменение часового пояса с помощью PowerShell
Чтобы определить текущий часовой пояс в консоли PowerShell, используйте одну из следующих команд:
[TimeZoneInfo]::Local
Get-TimeZone
Чтобы просмотреть список всех доступных часовых поясов в консоли PowerShell, вы также можете использовать одну из следующих команд:
Get-TimeZone -ListAvailable
[System.TimeZoneInfo]::GetSystemTimeZones()
Список всех часовых поясов достаточно велик, поэтому для удобства рекомендуется использовать фильтр, в котором указывается часть названия, например:
Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*FLE*"}
Чтобы изменить текущий часовой пояс из консоли PowerShell, введите команду:
Set-TimeZone -Name "FLE Standard Time"
*укажите название нужного часового пояса в кавычках.