January 22nd, 2015

PowerTip: Use PowerShell to Display date Format for Specific Culture

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to display date formatting for a specific culture.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see the short date pattern for a specific culture without
           changing my UI culture settings?

Hey, Scripting Guy! Answer Use the CultureInfo class from System.Globalization, call the GetCultureInfo static method
           while passing a culture number, and choose the ShortDatePattern property from the DateTime 
           format object, for example:

[System.Globalization.CultureInfo]::GetCultureInfo(1031).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.