Set-​Time​Zone

Sets the system time zone to a specified time zone.

Syntax

Set-TimeZone
   [-Confirm]
   -Id <String>
   [-PassThru]
   [-WhatIf]
   [<CommonParameters>]
Set-TimeZone
   [-InputObject] <TimeZoneInfo>
   [-Confirm]
   [-PassThru]
   [-WhatIf]
   [<CommonParameters>]
Set-TimeZone
   [-Name] <String>
   [-Confirm]
   [-PassThru]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-TimeZone cmdlet sets the system time zone to a specified time zone.

Examples

Example 1: Set the time zone on the computer

PS C:\> Set-TimeZone -Name "Pacific Standard Time"

This command sets the time zone on the local computer to Pacific Standard Time.

Required Parameters

-Id

Specifies the ID of the time zone that this cmdlet sets.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-InputObject

Specifies a TimeZoneInfo object to use as input.

Type:TimeZoneInfo
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of the time zone that this cmdlet sets.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String, System.TimeZoneInfo, System.String