How do I get 'date-1' formatted as mm-dd-yyyy using PowerShell?

The Solution to How do I get 'date-1' formatted as mm-dd-yyyy using PowerShell? is


You can use the .tostring() method with datetime format specifiers to format to whatever you need:

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

(Get-Date).AddDays(-1).ToString('MM-dd-yyyy')
11-01-2013

~ Answered on 2013-11-02 12:50:12


Most Viewed Questions: