การเปลี่ยนการตั้งค่าโซนเวลาใน Windows ผ่าน CMD, PowerShell และ GPO
โซนเวลา พร้อมด้วยเวลาและวันที่ เป็นหนึ่งในพารามิเตอร์ที่สำคัญของคอมพิวเตอร์ เพื่อให้ Windows และแอปพลิเคชันทำงานได้อย่างถูกต้อง ต้องตั้งค่าเขตเวลาให้สอดคล้องกับตำแหน่งทางภูมิศาสตร์ของคอมพิวเตอร์ ในบทความนี้ เราจะดูวิธีเปลี่ยนโซนเวลาใน Windows จาก GUI, Command Prompt, PowerShell และการใช้ Group Policy
แอปการตั้งค่าใหม่ใช้ใน Windows 10 และ Windows Server 2019/2016 เพื่อตั้งค่าวันที่และเขตเวลา คุณสามารถตั้งค่าเขตเวลาได้จาก GUI โดยคลิกขวาที่ไอคอนนาฬิกาในซิสเต็มเทรย์แล้วเลือก ปรับวันที่/เวลา ตามค่าเริ่มต้น Windows จะพยายามเลือกโซนเวลาโดยอัตโนมัติ (เปิดใช้ตัวเลือก ตั้งค่าโซนเวลาอัตโนมัติ) คุณสามารถปิดใช้งานตัวเลือกนี้และตั้งค่าเขตเวลาที่ต้องการด้วยตนเองโดยเลือกในรายการแบบหล่นลง
เคล็ดลับ คุณยังสามารถใช้แอพเพล็ตแผงควบคุม "วันที่และเวลา" แบบคลาสสิกเพื่อเปลี่ยนการตั้งค่าโซนเวลาใน Windows เรียกใช้คำสั่ง
timedate.cplอนุญาตหรือป้องกันไม่ให้ผู้ใช้เปลี่ยนเขตเวลาใน Windows
ตามค่าเริ่มต้น ผู้ใช้ไม่จำเป็นต้องมีสิทธิ์ของผู้ดูแลระบบในการเปลี่ยนโซนเวลา (ไม่เหมือนกับการเปลี่ยนวันที่/เวลา) ลักษณะการทำงานนี้สามารถเปลี่ยนแปลงได้โดยใช้คอนโซล การตั้งค่าความปลอดภัยในตัวเครื่อง (
secpol.msc). ไปที่ การตั้งค่าความปลอดภัย -> นโยบายท้องถิ่น -> การกำหนดสิทธิ์ของผู้ใช้ นโยบายนี้เรียกว่า เปลี่ยนเขตเวลา อย่างที่คุณเห็น ระบบ ผู้ดูแลระบบ และผู้ใช้ทั้งหมดสามารถเปลี่ยนแปลงเขตเวลาได้ เพื่อป้องกันไม่ให้ผู้ใช้เปลี่ยนเขตเวลา ให้ลบกลุ่ม ผู้ใช้ ออกจากรายการบัญชีในนโยบายนี้
ใน Windows Server เฉพาะ Local Service และผู้ดูแลระบบเท่านั้นที่มีสิทธิ์เปลี่ยนโซนเวลา
ใน Hyper-V Server และ Windows Server Core คุณสามารถตั้งค่าเขตเวลาได้โดยใช้ยูทิลิตี้ sconfig ในตัว
TZUtil.exe: จะเปลี่ยนโซนเวลาใน Windows 10 CMD ได้อย่างไร
หากต้องการเปลี่ยนเขตเวลาใน Windows 11/10/8.1 และ Windows Server 2019/2016/2012 R2/ จะใช้เครื่องมือบรรทัดคำสั่งพิเศษ tzutil.exe (Windows Time Zone Utility) ปรากฏตัวครั้งแรกใน Windows 7 ไฟล์ปฏิบัติการของเครื่องมือนี้อยู่ใน
%WINDIR%\System32ไดเรกทอรี
ลองพิจารณาคุณสมบัติและความสามารถของเครื่องมือ TZUtil.exe
เรียกใช้พรอมต์คำสั่ง (
cmd.exe
). หากต้องการทราบเขตเวลาปัจจุบันและตัวระบุ (TimeZoneID) ให้รันคำสั่ง:
tzutil /gในตัวอย่างนี้ เวลามาตรฐานแปซิฟิก เป็นตัวระบุโซนเวลาปัจจุบัน
แสดงรายการเขตเวลาที่มีอยู่ทั้งหมดดังนี้:
tzutil /lTimeZone Id | TimeZone DisplayName
Dateline Standard Time | (UTC-12:00) International Date Line West
UTC-11 | (UTC-11:00) Coordinated Universal Time-11
Aleutian Standard Time | (UTC-10:00) Aleutian Islands
Hawaiian Standard Time | (UTC-10:00) Hawaii
Marquesas Standard Time | (UTC-09:30) Marquesas Islands
Alaskan Standard Time | (UTC-09:00) Alaska
UTC-09 | (UTC-09:00) Coordinated Universal Time-09
Pacific Standard Time (Mexico) | (UTC-08:00) Baja California
UTC-08 | (UTC-08:00) Coordinated Universal Time-08
Pacific Standard Time | (UTC-08:00) Pacific Time (US & Canada)
US Mountain Standard Time | (UTC-07:00) Arizona
Mountain Standard Time (Mexico) | (UTC-07:00) Chihuahua, La Paz, Mazatlan
Mountain Standard Time | (UTC-07:00) Mountain Time (US & Canada)
Central America Standard Time | (UTC-06:00) Central America
Central Standard Time | (UTC-06:00) Central Time (US & Canada)
Easter Island Standard Time | (UTC-06:00) Easter Island
Central Standard Time (Mexico) | (UTC-06:00) Guadalajara, Mexico City, Monterrey
Canada Central Standard Time | (UTC-06:00) Saskatchewan
SA Pacific Standard Time | (UTC-05:00) Bogota, Lima, Quito, Rio Branco
Eastern Standard Time (Mexico) | (UTC-05:00) Chetumal
Eastern Standard Time | (UTC-05:00) Eastern Time (US & Canada)
Haiti Standard Time | (UTC-05:00) Haiti
Cuba Standard Time | (UTC-05:00) Havana
US Eastern Standard Time | (UTC-05:00) Indiana (East)
Turks And Caicos Standard Time | (UTC-05:00) Turks and Caicos
Paraguay Standard Time | (UTC-04:00) Asuncion
Atlantic Standard Time | (UTC-04:00) Atlantic Time (Canada)
Venezuela Standard Time | (UTC-04:00) Caracas
Central Brazilian Standard Time | (UTC-04:00) Cuiaba
SA Western Standard Time | (UTC-04:00) Georgetown, La Paz, Manaus, San Juan
Pacific SA Standard Time | (UTC-04:00) Santiago
Newfoundland Standard Time | (UTC-03:30) Newfoundland
Tocantins Standard Time | (UTC-03:00) Araguaina
E. South America Standard Time | (UTC-03:00) Brasilia
SA Eastern Standard Time | (UTC-03:00) Cayenne, Fortaleza
Argentina Standard Time | (UTC-03:00) City of Buenos Aires
Greenland Standard Time | (UTC-03:00) Greenland
Montevideo Standard Time | (UTC-03:00) Montevideo
Magallanes Standard Time | (UTC-03:00) Punta Arenas
Saint Pierre Standard Time | (UTC-03:00) Saint Pierre and Miquelon
Bahia Standard Time | (UTC-03:00) Salvador
UTC-02 | (UTC-02:00) Coordinated Universal Time-02
Mid-Atlantic Standard Time | (UTC-02:00) Mid-Atlantic - Old
Azores Standard Time | (UTC-01:00) Azores
Cape Verde Standard Time | (UTC-01:00) Cabo Verde Is.
UTC | (UTC) Coordinated Universal Time
Morocco Standard Time | (UTC+00:00) Casablanca
GMT Standard Time | (UTC+00:00) Dublin, Edinburgh, Lisbon, London
Greenwich Standard Time | (UTC+00:00) Monrovia, Reykjavik
W. Europe Standard Time | (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Central Europe Standard Time | (UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
Romance Standard Time | (UTC+01:00) Brussels, Copenhagen, Madrid, Paris
Sao Tome Standard Time | (UTC+01:00) Sao Tome
Central European Standard Time | (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb
W. Central Africa Standard Time | (UTC+01:00) West Central Africa
Jordan Standard Time | (UTC+02:00) Amman
GTB Standard Time | (UTC+02:00) Athens, Bucharest
Middle East Standard Time | (UTC+02:00) Beirut
Egypt Standard Time | (UTC+02:00) Cairo
E. Europe Standard Time | (UTC+02:00) Chisinau
Syria Standard Time | (UTC+02:00) Damascus
West Bank Standard Time | (UTC+02:00) Gaza, Hebron
South Africa Standard Time | (UTC+02:00) Harare, Pretoria
FLE Standard Time | (UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
Israel Standard Time | (UTC+02:00) Jerusalem
Kaliningrad Standard Time | (UTC+02:00) Kaliningrad
Sudan Standard Time | (UTC+02:00) Khartoum
Libya Standard Time | (UTC+02:00) Tripoli
Namibia Standard Time | (UTC+02:00) Windhoek
Arabic Standard Time | (UTC+03:00) Baghdad
Turkey Standard Time | (UTC+03:00) Istanbul
Arab Standard Time | (UTC+03:00) Kuwait, Riyadh
Belarus Standard Time | (UTC+03:00) Minsk
Russian Standard Time | (UTC+03:00) Moscow, St. Petersburg, Volgograd
E. Africa Standard Time | (UTC+03:00) Nairobi
Iran Standard Time | (UTC+03:30) Tehran
Arabian Standard Time | (UTC+04:00) Abu Dhabi, Muscat
Astrakhan Standard Time | (UTC+04:00) Astrakhan, Ulyanovsk
Azerbaijan Standard Time | (UTC+04:00) Baku
Russia Time Zone 3 | (UTC+04:00) Izhevsk, Samara
Mauritius Standard Time | (UTC+04:00) Port Louis
Saratov Standard Time | (UTC+04:00) Saratov
Georgian Standard Time | (UTC+04:00) Tbilisi
Caucasus Standard Time | (UTC+04:00) Yerevan
Afghanistan Standard Time | (UTC+04:30) Kabul
West Asia Standard Time | (UTC+05:00) Ashgabat, Tashkent
Ekaterinburg Standard Time | (UTC+05:00) Ekaterinburg
Pakistan Standard Time | (UTC+05:00) Islamabad, Karachi
India Standard Time | (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
Sri Lanka Standard Time | (UTC+05:30) Sri Jayawardenepura
Nepal Standard Time | (UTC+05:45) Kathmandu
Central Asia Standard Time | (UTC+06:00) Astana
Bangladesh Standard Time | (UTC+06:00) Dhaka
Omsk Standard Time | (UTC+06:00) Omsk
Myanmar Standard Time | (UTC+06:30) Yangon (Rangoon)
SE Asia Standard Time | (UTC+07:00) Bangkok, Hanoi, Jakarta
Altai Standard Time | (UTC+07:00) Barnaul, Gorno-Altaysk
W. Mongolia Standard Time | (UTC+07:00) Hovd
North Asia Standard Time | (UTC+07:00) Krasnoyarsk
N. Central Asia Standard Time | (UTC+07:00) Novosibirsk
Tomsk Standard Time | (UTC+07:00) Tomsk
China Standard Time | (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi
North Asia East Standard Time | (UTC+08:00) Irkutsk
Singapore Standard Time | (UTC+08:00) Kuala Lumpur, Singapore
W. Australia Standard Time | (UTC+08:00) Perth
Taipei Standard Time | (UTC+08:00) Taipei
Ulaanbaatar Standard Time | (UTC+08:00) Ulaanbaatar
North Korea Standard Time | (UTC+08:30) Pyongyang
Aus Central W. Standard Time | (UTC+08:45) Eucla
Transbaikal Standard Time | (UTC+09:00) Chita
Tokyo Standard Time | (UTC+09:00) Osaka, Sapporo, Tokyo
Korea Standard Time | (UTC+09:00) Seoul
Yakutsk Standard Time | (UTC+09:00) Yakutsk
Cen. Australia Standard Time | (UTC+09:30) Adelaide
AUS Central Standard Time | (UTC+09:30) Darwin
E. Australia Standard Time | (UTC+10:00) Brisbane
AUS Eastern Standard Time | (UTC+10:00) Canberra, Melbourne, Sydney
West Pacific Standard Time | (UTC+10:00) Guam, Port Moresby
Tasmania Standard Time | (UTC+10:00) Hobart
Vladivostok Standard Time | (UTC+10:00) Vladivostok
Lord Howe Standard Time | (UTC+10:30) Lord Howe Island
Bougainville Standard Time | (UTC+11:00) Bougainville Island
Russia Time Zone 10 | (UTC+11:00) Chokurdakh
Magadan Standard Time | (UTC+11:00) Magadan
Norfolk Standard Time | (UTC+11:00) Norfolk Island
Sakhalin Standard Time | (UTC+11:00) Sakhalin
Central Pacific Standard Time | (UTC+11:00) Solomon Is., New Caledonia
Russia Time Zone 11 | (UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky
New Zealand Standard Time | (UTC+12:00) Auckland, Wellington
UTC+12 | (UTC+12:00) Coordinated Universal Time+12
Fiji Standard Time | (UTC+12:00) Fiji
Kamchatka Standard Time | (UTC+12:00) Petropavlovsk-Kamchatsky - Old
Chatham Islands Standard Time | (UTC+12:45) Chatham Islands
UTC+13 | (UTC+13:00) Coordinated Universal Time+13
Tonga Standard Time | (UTC+13:00) Nuku'alofa
Samoa Standard Time | (UTC+13:00) Samoa
Line Islands Standard Time | (UTC+14:00) Kiritimati Islandรายการโซนเวลาปัจจุบันใน Windows จาก Microsoft มีอยู่ที่นี่
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones
หากคุณต้องการค้นหาโซนเวลาที่มีอยู่ทั้งหมดอย่างรวดเร็ว (เช่น ด้วย
UTC -6offset) ให้รันคำสั่ง:
tzutil /l | find /I "utc-06"
เปลี่ยนเขตเวลาปัจจุบันเป็น (UTC-05:00) เวลาตะวันออก (สหรัฐอเมริกา & แคนาดา):
tzutil /s "Eastern Standard Time"เขตเวลาปัจจุบันถูกจัดเก็บไว้ในรีจิสทรีของ Windows คุณสามารถตรวจสอบว่ามีการเปลี่ยนแปลงดังนี้:
reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformationหากต้องการปิดใช้งานการปรับเวลาตามฤดูกาลสำหรับเขตเวลาใดเขตหนึ่ง คุณต้องระบุตัวระบุเขตเวลาด้วยคำต่อท้าย _dstoff เช่น
tzutil /s “Central European Standard Time_dstoff”คำสั่งนี้จะเปลี่ยนเขตเวลาของคอมพิวเตอร์และปิดใช้งานการเปลี่ยนนาฬิกาตามฤดูกาล
คุณสามารถแสดงข้อมูลทั้งหมดเกี่ยวกับโซนเวลาและการตั้งค่าเวลาออมแสงได้ดังนี้:
w32tm /tzTime zone: Current:TIME_ZONE_ID_UNKNOWN Bias: 480min (UTC=LocalTime+Bias)
[Standard Name:"Pacific Standard Time" Bias:0min Date:(unspecified)]
[Daylight Name:"Pacific Standard Time" Bias:0min Date:(unspecified)]หากต้องการเปลี่ยนโซนเวลาจากพรอมต์คำสั่งใน Windows XP และ Windows Server 2003 คุณต้องใช้คำสั่งต่อไปนี้
RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central America Standard Timeหรือ :
Control.exe TIMEDATE.CPL,,/Z Central America Standard Timeการตั้งค่า Windows Time Zone ผ่าน PowerShell
คุณสามารถรับการตั้งค่าโซนเวลาปัจจุบันได้จากคอนโซล PowerShell เรียกใช้คำสั่ง:
[TimeZoneInfo]::Localหรือ
Get-TimeZoneId : Pacific Standard Time
DisplayName : (UTC-08:00) Pacific Time (US & Canada)
StandardName : Pacific Standard Time
DaylightName : Pacific Standard Time
BaseUtcOffset : -08:00:00
SupportsDaylightSavingTime : Falseหากต้องการดูเขตเวลาทั้งหมดที่มีใน Windows คุณสามารถใช้คำสั่ง PowerShell:
[System.TimeZoneInfo]::GetSystemTimeZones()หรือ
Get-TimeZone -ListAvailableรายการโซนเวลาค่อนข้างยาว หากต้องการค้นหาชื่อเขตเวลาที่ต้องการ ให้ใช้ตัวเลือกการกรองของ PowerShell:
Get-TimeZone -ListAvailable | Where-Object {$_.displayname -like "*canada*"}หรือ :
Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*euro*"}คุณสามารถแสดงโซนเวลาทั้งหมดตามลำดับตัวอักษร:
Get-TimeZone -ListAvailable | Select Id | Sort Idหากต้องการเปลี่ยนเขตเวลาปัจจุบันจาก PowerShell ให้เรียกใช้คำสั่ง
Set-TimeZone -Name "US Eastern Standard Time"PowerShell เวอร์ชัน 5.1 ใช้ในตัวอย่างเหล่านี้ แต่ยังทำงานในเวอร์ชันที่ใหม่กว่าด้วย
การกำหนดค่าโซนเวลาโดยใช้นโยบายกลุ่ม
คุณสามารถใช้ Group Policy เพื่อกำหนดค่าโซนเวลาบนคอมพิวเตอร์ในโดเมน Active Directory ไม่มีพารามิเตอร์นโยบายในตัวใน GPO สำหรับการกำหนดค่าเขตเวลา ตัวเลือกที่ใช้บ่อยที่สุดสองตัวเลือกสำหรับการตั้งค่าโซนเวลาผ่าน GPO คือการใช้สคริปต์การเข้าสู่ระบบ GPO หรือนำเข้าการตั้งค่าโซนเวลาลงในรีจิสทรี
หากต้องการตั้งค่าโซนเวลาโดยใช้สคริปต์การเข้าสู่ระบบ GPO คุณสามารถใช้สคริปต์ PowerShell อย่างง่าย (ใช้ได้กับ Windows ทุกรุ่นตั้งแต่ Windows XP และ Windows Server 2003):
$timeZone = "Central Europe Daylight Time"
$WinOSVerReg = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
$WinOSVer = $WinOSVerReg.GetValue("CurrentVersion")
if ($WinOSVer -GE 6){
tzutil.exe /s $timeZone
} Else {
$params = "/c Start `"Change timeZone`" /MIN %WINDIR%\System32\Control.exe TIMEDATE.CPL,,/Z "
$params += $timeZone
$proc = [System.Diagnostics.Process]::Start( "CMD.exe", $params )
}อีกวิธีในการตั้งค่าเขตเวลาสำหรับคอมพิวเตอร์ที่เข้าร่วมโดเมนคือการนำเข้าเนื้อหาของคีย์รีจิสทรี HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation จากคอมพิวเตอร์อ้างอิงที่มีการตั้งค่าเวลาที่กำหนดอย่างถูกต้องไปยังคอมพิวเตอร์เครื่องอื่น ผ่านทาง กปภ. บทความนี้อธิบายวิธีการนำเข้าพารามิเตอร์รีจิสทรีผ่าน Group Policy
เลือกคีย์รีจิสทรีนี้พร้อมพารามิเตอร์ทั้งหมดโดยใช้ Registry Browser ด้วยเหตุนี้ การตั้งค่าโซนเวลาทั้งหมดจะถูกนำเข้าไปยังตัวแก้ไข GPO (การกำหนดค่าคอมพิวเตอร์ -> การตั้งค่า -> การตั้งค่า Windows -> รีจิสทรี)
หากคุณต้องการใช้การตั้งค่าโซนเวลาที่แตกต่างกันสำหรับไซต์ Active Directory ต่างๆ ให้ใช้ GPP การกำหนดเป้าหมายระดับรายการ เพื่อกำหนดเป้าหมายการตั้งค่าโซนเวลาเฉพาะไปยังไซต์ AD
หากคุณใช้โครงสร้างพื้นฐาน RDS และผู้ใช้และเซิร์ฟเวอร์ RDSH ได้รับการกำหนดค่าด้วยโซนเวลาที่ต่างกัน เวลาของเซิร์ฟเวอร์จะแสดงในเซสชัน RDP ของผู้ใช้ มันไม่สะดวก คุณสามารถเปลี่ยนเส้นทางโซนเวลาท้องถิ่นของผู้ใช้ไปยังเซสชัน RDP โดยใช้พารามิเตอร์ GPO อนุญาตการเปลี่ยนเส้นทางโซนเวลา (การกำหนดค่าคอมพิวเตอร์ > นโยบาย -> เทมเพลตการดูแลระบบ -> ส่วนประกอบของ Windows -> บริการเดสก์ท็อประยะไกล -> เซสชันเดสก์ท็อประยะไกล โฮสต์ -> การเปลี่ยนเส้นทางอุปกรณ์และทรัพยากร
ไม่สามารถเปลี่ยนโซนเวลาบน Windows Server 2019 /Windows 10: คุณไม่ได้รับอนุญาต
Windows Server 2019 RTM และ Windows 10 บางรุ่นมีข้อผิดพลาดที่น่ารำคาญกับการตั้งค่าโซนเวลาผ่าน GUI หากคุณพยายามเปลี่ยนเขตเวลาจากแอปการตั้งค่าสมัยใหม่หรือผ่านแอปเพล็ตแผงควบคุมแบบคลาสสิก ข้อผิดพลาดจะปรากฏขึ้น:
Date and time
Unable to continue.
You do not have permission to perform this task. Please contact your computer administrator for help.ขั้นแรก ตรวจสอบให้แน่ใจว่าคุณเข้าสู่ระบบ Windows ภายใต้บัญชีที่มีสิทธิ์ของผู้ดูแลระบบ และกลุ่ม ผู้ดูแลระบบ อยู่ในการตั้งค่านโยบายความปลอดภัยในเครื่อง เปลี่ยนเขตเวลา
ในกรณีนี้ คุณจะต้องเปลี่ยนเขตเวลาจากบรรทัดคำสั่ง:
tzutil /l
tzutil /s "Central Europe Standard Time"หรือ PowerShell:
GetTimeZone -ListAvailable|? DisplayName -like "*Berlin*"|Set-TimeZoneหากคุณต้องการเปลี่ยนการตั้งค่าโซนเวลาจากอินเทอร์เฟซแบบกราฟิก คุณต้องปรับ
timedate.cplแอปเพล็ตจากพรอมต์คำสั่งหรือเปิดจาก Server Manager (Local Server -> Time zone)
โซนเวลาในกล่องจดหมาย Exchange (Microsoft 365) ถูกตั้งค่าในการเชื่อมต่อครั้งแรกตามการตั้งค่าโปรไฟล์ผู้ใช้ Windows

















