Use Culture-Specific Dates!

by Mar 16, 2010

PowerShell always uses a culture-neutral approach when you implicitly convert a date. So this does not necessarily work with your own culture.

[DateTime]'24.1.2010'

Instead, a culture-aware way is to use the -as operator:

'24.1.2010' -as [DateTime]

This time, you can see that the string information is interpreted according to your current culture.