Date Time format displays differently in ISE and Windows Forms
问题 When I run Get-Date in ISE, I get Wednesday, 15 April 2020 12:38:03 PM which I want. However, if I run the same command in Windows Forms, I get 04/15/2020 12:38:03 in a different format. I run them from the same computer so it must be the same cultural/region. 回答1: 1. Customizing your date using -Format or -UFormat You can use the -Format or the -UFormat paramater to enforce a certain layout of your date: Get-Date -Format "dddd, d MMMM yyyy hh:mm:ss tt" Get-Date -UFormat "%A, %e %B %Y %r"