Reputation: 55
I have an AD property that contains birthdays in the format of DD-MMM (31-Jan). I need to query this via powershell and return it as 01/31. I have attempted ParseExact, 31-Jan is not recognized as a valid date format.
Thanks in advance for any help I am a powershell novice. What am I missing here.
Upvotes: 0
Views: 63
Reputation: 7163
You can just use Parse.
Example:
[DateTime]::Parse("31-jan").ToString("MM/dd")
I would think this should get you unblocked.
Upvotes: 2