Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

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 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>