Set-Time
Zone
Syntax
Set-TimeZone
[-Name] <String>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-TimeZone
-Id <String>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-TimeZone
[-InputObject] <TimeZoneInfo>
[-PassThru]
[-WhatIf]
[-Confirm]
[<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
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 |
Specifies a TimeZoneInfo object to use as input.
Type: | TimeZoneInfo |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
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
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 |
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 |
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