Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Display the Date in Month, Day, Year Format

$
0
0

Summary: Learn how to use Windows PowerShell to display the date in a month, day, and two-digit year format.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display the date in a month, day, and two-digit number format with a hyphen between each of the elements?

Hey, Scripting Guy! Answer Use the ToString method from the Get-Date cmdlet and specify a pattern to achieve your desired results:

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

03-11-13


Viewing all articles
Browse latest Browse all 3333

Trending Articles