2

I can get the Windows system local time zone as a Windows time zone identifier by passing the /g parameter to the tzutil utility.

For example:

C:\> tzutil /g
Pacific Standard Time

But how can I get the equivalent IANA time zone identifier, America/Los_Angeles?

1 Answers1

3

This can be done by calling the GetTimeZone method on an instance of the UWP/WinRT class Windows.Globalization.Calendar constructed with no parameters.

As a PowerShell one-liner:

PS C:\> [Windows.Globalization.Calendar,Windows.Globalization,ContentType=WindowsRuntime]::New().GetTimeZone()
America/Los_Angeles