Edit

Share via


Get-TimeZone

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

Syntax

Name (Default)

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

Id

Get-TimeZone
    -Id <String[]>
    [<CommonParameters>]

ListAvailable

Get-TimeZone
    [-ListAvailable]
    [<CommonParameters>]

Description

The Get-TimeZone cmdlet gets the current time zone or a list of available time zones.

Examples

Example 1: Get the current time zone

Get-TimeZone

This command gets the current time zone.

Example 2: Get time zones that match a specified string

Get-TimeZone -Name "*pac*"
Pacific Standard Time (Mexico)

(UTC-08:00) Pacific Time (US &amp; Canada)

Pacific Standard Time

SA Pacific Standard Time

Pacific SA Standard Time

West Pacific Standard Time

Central Pacific Standard Time

This command gets all time zones that match the specified wildcard.

Example 3: Get all available time zones

Get-TimeZone -ListAvailable

This command gets all available time zones.

Parameters

-Id

Specifies, as a string array, the ID or IDs of the time zones that this cmdlet gets.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ListAvailable

Indicates that this cmdlet gets all available time zones.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ListAvailable
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies, as a string array, the name or names of the time zones that this cmdlet gets.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

Name
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

TimeZoneInfo

Notes

Windows PowerShell includes the following aliases for Get-TimeZone:

  • gtz