Returns a date/time as a named format.
Format-Date.ps1 [-Format] <String> [[-Date] <DateTime>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Format-Date Iso8601WeekDate 2021-01-20
2021-W03-3
'Feb 2, 2020 8:20 PM +00:00' |Format-Date Iso8601Z
2020-02-02T20:20:00Z
The format to serialize the date as.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The date/time value to format.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: (Get-Date)
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: 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.