We have a Windows Server with the Region settings for short dates set to dd.MM.yyyy
. However powershell outputs the dates as MM/dd/yyyy
:
$d = (Get-Item .\somefile.txt).CreationTime
Write-Output "$d" # => 09/26/2016 15:35:35
Also, the toString() function returns a different (correct) format
Write-Output "$($d.toString())" # => 26.09.2016 15:35:35
Questions:
- Why does powershell use MM/dd/yyyy?
- Why are the 2 formats above different?
- I know we can set the format in our powershell profile but is there no "System" setting which determines it?