Set-TimeZone
Sets the system time zone to a specified time zone.
구문
Name (기본값)
Set-TimeZone
[-Name] <String>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Id
Set-TimeZone
-Id <String>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
InputObject
Set-TimeZone
[-InputObject] <TimeZoneInfo>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-TimeZone
cmdlet sets the system time zone to a specified time zone.
예제
Example 1: Set the time zone by Id
This example sets the time zone on the local computer to UTC.
Set-TimeZone -Id "UTC"
Id : UTC
DisplayName : (UTC) Coordinated Universal Time
StandardName : Coordinated Universal Time
DaylightName : Coordinated Universal Time
BaseUtcOffset : 00:00:00
SupportsDaylightSavingTime : False
Example 2: Set the time zone by name
This example sets the time zone on the local computer to UTC.
Set-TimeZone -Name 'Coordinated Universal Time' -PassThru
As we saw in the previous example, the Id and the Name of the Time Zone do not always match. The Name parameter must match the StandardName or DaylightName properties of the TimeZoneInfo object.
Note
The time zone names can vary based on the Culture settings in Windows. This example shows the
values for a system set to en-US
.
Example 3 - List all available time zones
A full list of Time Zone IDs can be obtained by running the following command:
Get-TimeZone -ListAvailable
매개 변수
-Confirm
Prompts you for confirmation before running the cmdlet.
매개 변수 속성
형식: | SwitchParameter |
Default value: | False |
와일드카드 지원: | False |
DontShow: | False |
별칭: | cf |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-Id
Specifies the ID of the time zone that this cmdlet sets.
매개 변수 속성
형식: | String |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
Id
Position: | Named |
필수: | True |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-InputObject
Specifies a TimeZoneInfo object to use as input.
매개 변수 속성
형식: | TimeZoneInfo |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
InputObject
Position: | 0 |
필수: | True |
파이프라인의 값: | True |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-Name
Specifies the name of the time zone that this cmdlet sets. A full list of Time Zone names can be
obtained by running the following command: Get-TimeZone -ListAvailable
.
매개 변수 속성
형식: | String |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
Name
Position: | 0 |
필수: | True |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-PassThru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
매개 변수 속성
형식: | SwitchParameter |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
매개 변수 속성
형식: | SwitchParameter |
Default value: | False |
와일드카드 지원: | False |
DontShow: | False |
별칭: | wi |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | 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.
입력
String
TimeZoneInfo
출력
None
By default, this cmdlet returns no output.
TimeZoneInfo
When you use the PassThru parameter, this cmdlet returns a TimeZoneInfo object.
참고
Windows PowerShell includes the following aliases for Set-TimeZone
:
stz