January 21st, 2015

PowerTip: Use PowerShell to Display Format for Short Date

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to display the culture-specific format for a short date.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display the format of a short date that is specific to the culture settings
           of my system?

Hey, Scripting Guy! Answer Use the Get-Culture cmdlet and select the DateTimeFormat and ShortDatePattern properties:

(Get-Culture).DateTimeFormat.ShortDatePattern

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.