Tests whether the given string can be parsed as a date.
Test-DateTime.ps1 [-Date] <String> [-Format <String[]>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Test-DateTime.ps1 '2017-02-29T11:38:00'
False
Test-DateTime.ps1 '2000-2-29T9:33:00' -Format 'yyyy-M-dTH:mm:ss'
True
Test-Datetime.ps1 970313 -Format 'yyMMdd'
True
Test-DateTime.ps1 '1900-02-29'
False
The string to test for datetime parseability.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Precise, known format(s) to use to try parsing the datetime.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
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.