Home Dashboard Directory Help
Search

Get-Date -ParseExact parameter aka DateTime.ParseExact() for more flexible input format by S.K. _


Status: 

Active


1
1
Sign in
to vote
Type: Suggestion
ID: 775216
Opened: 12/27/2012 6:45:14 AM
Access Restriction: Public
0
Workaround(s)
view

Description

#### Sample ####

PS > Get-Date 20121227 -ParseExact yyyyMMdd

2012/12/27 0:00:00


PS > Get-Date "Wed, 25 Dec 2002 13:32:22 +0900" -ParseExact "ddd, d MMM yyyy HH:mm:ss zzz"

2002/12/25 13:32:22




#### Currently workaround ####

PS > [DateTime]::ParseExact( "20121227", "yyyyMMdd", $null )

2012/12/27 0:00:00


PS > [DateTime]::ParseExact( "Wed, 25 Dec 2002 13:32:22 +0900", "ddd, d MMM yyyy HH:mm:ss zzz", [Globalization.DateTimeFormatInfo]::InvariantInfo )

2002/12/25 13:32:22
Details
Sign in to post a comment.
Sign in to post a workaround.