I have no idea how widely known this is, but it annoyed me for an hour or
so.

PS C:\> *(Get-Date).ToString()*
23/06/2022 2:06:24 PM

PS C:\> *"$(Get-Date)"*
06/23/2022 14:06:33

Huh?

I know why there's a difference.  Anyone been stung by that before?

The implicit conversion does this:

PS C:\>
*(Get-Date).ToString($null,[System.Globalization.CultureInfo]::InvariantCulture)*
06/23/2022 14:07:43

Regards,

RC

Reply via email to