More date oddities

I’ve mentioned before that if I do this

[datetime]"10/09/2011"

I get

09 October 2011 00:00:00

which is not what I expect as I live in the UK

 

Just been experimenting and discovered that

Get-Date "10/09/2011"

 

works correctly (for me) and returns

10 September 2011 00:00:00

 

It seems Get-Date picks up the locale and culture correctly but casting to [datetime] doesn’t.

Published Sat, Feb 19 2011 19:25 by RichardSiddaway
Filed under:

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: