Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell date/time conversion

Tags:

powershell

I have a variable, $date, containing 24 June 2012 00:00:00.

How do I convert this to 24/06/2012?

like image 838
meeeeeeeeee Avatar asked Sep 07 '12 08:09

meeeeeeeeee


1 Answers

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
like image 102
Shay Levy Avatar answered Oct 28 '22 19:10

Shay Levy