I have a variable, $date, containing 24 June 2012 00:00:00
.
How do I convert this to 24/06/2012
?
Use the Get-Date
cmdlet together with the Format parameter:
PS> $date = '24 June 2012 00:00:00'
PS> Get-Date $date -Format 'dd/MM/yyyy'
24/06/2012
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With