PowerTip: Use PowerShell to Display Date Formats

Doctor Scripto

Summary: Use Windows PowerShell to easily change the way the date displays on your computer.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display the date on my computer as a two-digit month, two-digit day,
          and two-digit year?

Hey, Scripting Guy! Answer Use the ToString() method from the Get-Date cmdlet. Here are two examples:

PS C:\> (get-date).tostring("MM/dd/yy")


PS C:\> (get-date).tostring("MMddyy")



Comments are closed. Login to edit/delete your existing comments

Feedback usabilla icon