Hey PowerShell Guy !,How Can I Separate The Month From the Year in a Date String Like 122007?
How Can I Separate The Month From the Year in a Date String Like 122007?
[datetime]::ParseExact(122007,'Myyyy',$null) | ft Month,Year
You can see you can use ParseExact to convert a custom format to d dateTime OBject from there it is simple of course
PS> [datetime]::ParseExact(122007,'Myyyy',$null)
zaterdag 1 december 2007 0:00:00
PS l> [datetime]::ParseExact(122007,'Myyyy',$null) | fl Month,Year
Month : 12
Year : 2007
Enjoy,
Greetings /\/\o\/\/