Get the current time zone or a list of available time zones.

      Get-TimeZone -Id String[] [CommonParameters]

      Get-TimeZone -ListAvailable [CommonParameters]

      Get-TimeZone [[-Name] String[]] [CommonParameters]

   -Id             Specify the ID or IDs of the time zones to get.

   -ListAvailable  Get all the available time zones.

   -Name           Specify the name or names of the time zones to get.

Standard Aliases for Get-TimeZone: gtz


Get the current time zone:

PS C:\> Get-TimeZone
Pacific Standard Time

Get all available time zones:

PS C:\> Get-TimeZone -ListAvailable

Get time zones that match a specified string:

PS C:\> Get-TimeZone -Name "*pac*" | select standardname
Pacific Standard Time
SA Pacific Standard Time

The time zone set on a machine might not match the current location, a public web service like worldtimeapican lookup your approximate location and estimate a time zone based on your internet connection:

PS C:\> Invoke-RestMethod -Uri '' | select timezone

“ The greatest things in life tend to happen outside our comfort zones, and doubting your ability to step outside of your comfort zone will keep you stuck” ~ Amy Morin

Related PowerShell Cmdlets:

Invoke-RestMethod - Send an HTTP or HTTPS request to a RESTful web service.
Set-TimeZone - Set the system time zone to a specified time zone.

Copyright © 1999-2021
Some rights reserved