Converting date time format in PowerShell
问题 How do I convert the following date into the dd/mm/yyyy format? Tue Aug 4 17:05:41 2015 I tried multiple things and options, but no luck. $a = Get-Date -UFormat %c (Get-Date $a).ToString("ddMMyyyy") This dateformat was found in a log file and my system datetime format is dd/mm/yyyy. I am trying to do a comparison between them. So, I need to change the date time format. 回答1: The answer from @jisaak is almost spot on, except for the fact that the extra padding space in front of the date