Set-TimeZone
Set-TimeZone [-Confirm] -Id* <String> [-PassThru] [-WhatIf] [<CommonParameters>]
Set-TimeZone [-InputObject*] <TimeZoneInfo> [-Confirm] [-PassThru] [-WhatIf] [<CommonParameters>]
Set-TimeZone [-Name*] <String> [-Confirm] [-PassThru] [-WhatIf] [<CommonParameters>]
The Set-TimeZone cmdlet sets the system time zone to a specified time zone.
Parameters
-Confirm [<SwitchParameter>]
- Default value is False
- Accepts pipeline input False
Prompts you for confirmation before running the cmdlet.
-Id <String>
- This value is required
- Default value is None
- Accepts pipeline input ByPropertyName
Specifies the ID of the time zone that this cmdlet sets.
-InputObject <TimeZoneInfo>
- This value is required
- Default value is None
- Accepts pipeline input ByValue
Specifies a TimeZoneInfo object to use as input.
-Name <String>
- This value is required
- Default value is None
- Accepts pipeline input False
Specifies the name of the time zone that this cmdlet sets.
-PassThru [<SwitchParameter>]
- Default value is False
- Accepts pipeline input False
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
-WhatIf [<SwitchParameter>]
- Default value is False
- Accepts pipeline input False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.
Inputs
System.String, System.TimeZoneInfo, System.StringExamples
-
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.
Additional Notes
This work is licensed under a Creative Commons Attribution 4.0 International. It is attributed to Microsoft Corporation and can be found here.
PowerShell Commands