January 7th, 2015

PowerTip: Find Time Zone Names with PowerShell

Doctor Scripto
Scripter

Summary: Find time zone enumeration names with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to enumerate the names of time zones that are configured on my computer?

Hey, Scripting Guy! Answer Use the System.TimeZoneInfo .NET Framework class, and use the GetSystemTimeZones static method
           to obtain the list. You want the ID property for enumeration values and the DisplayName property to see
           the standard display name values. Here is an example:

[timezoneinfo]::GetSystemTimeZones() | select displayname, id

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.