external help file | Module Name | online version | schema |
---|---|---|---|
PSDates-help.xml |
PSDates |
2.0.0 |
Convert a datetime value from one time zone to another
Convert-TimeZone [-ToTimeZone] <String> [[-Date <DateTime>]] [[-FromTimeZone <String>]] [-ProgressAction <ActionPreference>] [<CommonParameters>]
This function will allows you to pass a date to convert from one time zone to another. If no date is specified the local time is used. If no FromTimeZone is passed then the local time zone is used. If you don't know the time zone ID you can use the Find-TimeZone cmdlet.
Convert-TimeZone -ToTimeZone "GMT Standard Time"
Convert the local system time to GMT Standard Time
Convert-TimeZone -date '11/17/2017 12:34 AM' -FromTimeZone "China Standard Time" -ToTimeZone "US Mountain Standard Time"
Converts the date and time 11/17/2017 12:34 AM from 'China Standard Time' to 'US Mountain Standard Time'
The date to convert. If not specified the current time will be used
Type: DateTime
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (None) False (All)
Position: 1
Default value: $(Get-Date)
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
The time zone ID of the time zone you want to convert the date from. If not specified the local time zone will be used
Type: String
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (None) False (All)
Position: 2
Default value: [System.TimeZoneInfo]::Local.Id.ToString()
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Accepted values:
Required: True (None) False (All)
Position: Named
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
The time zone ID of the time zone you want to convert the date to
Type: String
Parameter Sets: (All)
Aliases:
Accepted values:
Required: True (All) False (None)
Position: 0
Default value:
Accept pipeline input: False
Accept wildcard characters: False
DontShow: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Fill Related Links Here