May 23rd, 2014

PowerTip: Use PowerShell to Display Date Formats

Doctor Scripto
Scripter

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")

05/19/14

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

051914

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback