Time zone นอกจากเวลาและวันที่แล้ว ยังเป็นหนึ่งในพารามิเตอร์สำคัญของคอมพิวเตอร์ เพื่อให้ Windows และแอปพลิเคชันทำงานได้อย่างถูกต้อง Time zone ต้องตั้งค่าตามตำแหน่งทางภูมิศาสตร์ของคอมพิวเตอร์ ในบทความนี้ เราจะดูวิธีการเปลี่ยน time zone ใน Windows จาก GUI, Command Prompt, PowerShell และการใช้ Group Policy
แอป Settings ใหม่ถูกใช้ใน Windows 10 และ Windows Server 2019/2016 เพื่อตั้งค่าวันที่และ time zone คุณสามารถตั้งค่า time zone จาก GUI ได้โดยคลิกขวาที่ไอคอนนาฬิกาใน system tray และเลือก Adjust date/time โดยค่าเริ่มต้น Windows จะพยายามเลือก time zone อัตโนมัติ (ตัวเลือก Set time zone automatically เปิดอยู่) คุณสามารถปิดตัวเลือกนี้และตั้งค่า time zone ที่ต้องการด้วยตนเองโดยเลือกจากรายการแบบดรอปดาวน์


เคล็ดลับ: คุณยังสามารถใช้แอปเล็ต Control Panel แบบคลาสสิก “Date and Time” เพื่อเปลี่ยนการตั้งค่า time zone ใน Windows ได้ รันคำสั่ง timedate.cpl

محتويات:
- อนุญาตหรือป้องกันไม่ให้ผู้ใช้เปลี่ยน Time Zone ใน Windows
- TZUtil.exe: วิธีเปลี่ยน Time Zone ใน Windows 10 CMD
- การตั้งค่า Windows Time Zone ผ่าน PowerShell
- การกำหนดค่า Time Zone โดยใช้ Group Policy
- ไม่สามารถเปลี่ยน Time Zone บน Windows Server 2019 / Windows 10: You Do Not Have Permission
อนุญาตหรือป้องกันไม่ให้ผู้ใช้เปลี่ยน Time Zone ใน Windows
โดยค่าเริ่มต้น ผู้ใช้ไม่จำเป็นต้องมีสิทธิ์ Administrator เพื่อเปลี่ยน time zone (ไม่เหมือนการเปลี่ยนวันที่/เวลา) พฤติกรรมนี้สามารถเปลี่ยนแปลงได้โดยใช้คอนโซล Local Security Settings (secpol.msc) ไปที่ Security Settings -> Local Policy -> User Rights Assignment นโยบายชื่อว่า Change the time zone ตามที่เห็น time zone สามารถเปลี่ยนได้โดย system, administrators และ all users หากต้องการป้องกันไม่ให้ผู้ใช้เปลี่ยน time zone ให้ลบกลุ่ม Users ออกจากรายการบัญชีในนโยบายนี้

ใน Windows Server มีเพียง Local Service และ administrators เท่านั้นที่มีสิทธิ์เปลี่ยน time zone
ใน Hyper-V Server และ Windows Server Core คุณสามารถตั้งค่า time zone โดยใช้ยูทิลิตี้ในตัว sconfig
TZUtil.exe: วิธีเปลี่ยน Time Zone ใน Windows 10 CMD?
เพื่อเปลี่ยน time zone ใน Windows 11/10/8.1 และ Windows Server 2019/2016/2012 R2 ใช้เครื่องมือบรรทัดคำสั่งพิเศษ tzutil.exe (Windows Time Zone Utility) มันปรากฏครั้งแรกใน Windows 7 ไฟล์ executable ของเครื่องมือตั้งอยู่ในไดเรกทอรี %WINDIR%\System32
มาพิจารณาคุณสมบัติและความสามารถของเครื่องมือ TZUtil.exe
รัน command prompt (cmd.exe) เพื่อหา time zone ปัจจุบันและตัวระบุ (TimeZoneID) ให้รันคำสั่ง:
tzutil /g

ในตัวอย่างนี้ Pacific Standard Time คือตัวระบุ time zone ปัจจุบัน
แสดงรายการ time zone ที่มีอยู่ทั้งหมดดังนี้:
tzutil /l

TimeZone 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
รายการ time zone ปัจจุบันใน Windows จาก Microsoft ให้ที่นี่
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones.
หากคุณต้องการค้นหา time zone ที่มีอยู่ทั้งหมดอย่างรวดเร็ว (เช่น ด้วย offset UTC -6) ให้รันคำสั่ง:
tzutil /l | find /I "utc-06"

เปลี่ยน time zone ปัจจุบันเป็น (UTC-05:00) Eastern Time (US & Canada):
tzutil /s "Eastern Standard Time"

Time zone ปัจจุบันจัดเก็บใน Windows Registry คุณสามารถตรวจสอบว่ามันเปลี่ยนแล้วได้อย่างนี้:
reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

เพื่อปิดใช้งาน daylight saving time สำหรับ time zone เฉพาะ คุณต้องระบุตัวระบุ time zone พร้อม suffix _dstoff ตัวอย่างเช่น:
tzutil /s “Central European Standard Time_dstoff”
คำสั่งนี้จะเปลี่ยน time zone ของคอมพิวเตอร์และปิดการเปลี่ยนนาฬิกาตามฤดูกาล
คุณสามารถแสดงข้อมูลเต็มเกี่ยวกับการตั้งค่า time zone และ daylight-saving time ได้ดังนี้:
w32tm /tz
Time 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)]

ในการเปลี่ยน time zone จาก command prompt ใน 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
คุณสามารถดูการตั้งค่า time zone ปัจจุบันจากคอนโซล PowerShell ได้ รันคำสั่ง:
[TimeZoneInfo]::Local
หรือ
Get-TimeZone
Id : 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

เพื่อดู time zone ที่มีอยู่ทั้งหมดใน Windows คุณสามารถใช้คำสั่ง PowerShell:
[System.TimeZoneInfo]::GetSystemTimeZones()
หรือ
Get-TimeZone -ListAvailable

รายการ time zone ค่อนข้างยาว ในการหาชื่อ time zone ที่ต้องการ ให้ใช้ตัวเลือกการกรองของ PowerShell:
Get-TimeZone -ListAvailable | Where-Object {$_.displayname -like "*canada*"}
หรือ:
Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*euro*"}

คุณสามารถแสดงรายการ time zone ทั้งหมดตามลำดับอักษร:
Get-TimeZone -ListAvailable | Select Id | Sort Id
เพื่อเปลี่ยน time zone ปัจจุบันจาก PowerShell ให้รันคำสั่ง
Set-TimeZone -Name "US Eastern Standard Time"
ตัวอย่างเหล่านี้ใช้ PowerShell version 5.1 แต่ก็ทำงานในเวอร์ชันใหม่ๆ ได้เช่นกัน
การกำหนดค่า Time Zone โดยใช้ Group Policy
คุณสามารถใช้ Group Policy เพื่อกำหนดค่า time zone บนคอมพิวเตอร์ในโดเมน Active Directory ไม่มีพารามิเตอร์นโยบายในตัวใน GPO สำหรับกำหนดค่า time zone สองวิธีที่ใช้บ่อยที่สุดสำหรับการตั้งค่า time zone ผ่าน GPO คือการใช้ GPO logon script หรือการนำเข้าการตั้งค่า time zone ลงใน registry
เพื่อตั้งค่า time zone โดยใช้ GPO logon script คุณสามารถใช้สคริปต์ 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 )
}
อีกวิธีหนึ่งในการตั้งค่า time zone สำหรับคอมพิวเตอร์ที่เข้าร่วมโดเมนคือการนำเข้าเนื้อหาของคีย์รีจิสทรี HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation จากคอมพิวเตอร์อ้างอิงที่มีการตั้งค่าเวลาที่ถูกต้อง ไปยังคอมพิวเตอร์อื่นๆ ผ่าน GPO บทความนี้อธิบายวิธีนำเข้าพารามิเตอร์รีจิสทรีผ่าน Group Policy
เลือกคีย์รีจิสทรีพร้อมพารามิเตอร์ทั้งหมดโดยใช้ Registry Browser ผลคือการตั้งค่า time zone ทั้งหมดจะถูกนำเข้าไปใน GPO editor (Computer Configuration -> Preferences -> Windows Settings -> Registry)

หากคุณต้องการใช้การตั้งค่า time zone ที่แตกต่างกันสำหรับ Active Directory sites ที่แตกต่างกัน ให้ใช้ GPP Item Level Targeting เพื่อกำหนดเป้าหมายการตั้งค่า time zone เฉพาะไปยัง AD site

หากคุณใช้โครงสร้างพื้นฐาน RDS และผู้ใช้และเซิร์ฟเวอร์ RDSH ถูกกำหนดค่าด้วย time zone ที่ต่างกัน แล้วเวลาของเซิร์ฟเวอร์จะแสดงในเซสชัน RDP ของผู้ใช้ ไม่สะดวก คุณสามารถ redirect time zone ท้องถิ่นของผู้ใช้ไปยังเซสชัน RDP ได้โดยใช้พารามิเตอร์ GPO Allow time zone redirection (Computer Configuration > Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Device and Resource Redirection
ไม่สามารถเปลี่ยน Time Zone บน Windows Server 2019 / Windows 10: You Do Not Have Permission
Windows Server 2019 RTM และบิลด์ Windows 10 บางรุ่นมีข้อผิดพลาดที่น่ารำคาญกับการตั้งค่า time zone ผ่าน GUI หากคุณพยายามเปลี่ยน time zone จากแอป Settings สมัยใหม่หรือผ่านแอปเล็ต Control Panel แบบคลาสสิก จะมีข้อผิดพลาดปรากฏ:
Date and time Unable to continue. You do not have permission to perform this task. Please contact your computer administrator for help.

ก่อนอื่น ตรวจสอบว่าคุณล็อกอิน Windows ภายใต้บัญชีที่มีสิทธิ์ administrator และว่ากลุ่ม Administrators อยู่ในการตั้งค่านโยบายความปลอดภัยท้องถิ่น Change Time Zone

ในฐานะ workaround ในกรณีนี้ คุณจะต้องเปลี่ยน timezone จากบรรทัดคำสั่ง:
tzutil /l
tzutil /s "Central Europe Standard Time"
หรือ PowerShell:
GetTimeZone -ListAvailable|? DisplayName -like "*Berlin*"|Set-TimeZone
หากคุณต้องการเปลี่ยนการตั้งค่า time zone จากอินเทอร์เฟซกราฟิก คุณต้องรันแอปเล็ต timedate.cpl จาก command prompt ที่รันแบบ elevated หรือเปิดมันจาก Server Manager (Local Server -> Time zone)

Time zone ในกล่องจดหมาย Exchange (Microsoft 365) ถูกตั้งค่าครั้งแรกตามการตั้งค่าโปรไฟล์ผู้ใช้ Windows