Work in Australia and have received message from US that DateTime
is parsing string "Dec15" wrongly and returning Dec 15, 2016 instead of Dec 1, 2015. "Dec15" in snippets below are variables in real life.
var date = DateTime.Parse("Dec15", new CultureInfo("en-AU")); //returns December 1 2015
I can not replicate even after changing my PC Formats & Location to point to US.
However, I can replicate if I change the code to use a US culture.
var date = DateTime.Parse("Dec15", new CultureInfo("en-US")); //returns December 15 2016
I'm not aware the code has been a problem in the past. I would like some help understanding why the CultureInfo
is being ignored/replaced with what appears to be there default Cultures over there in the US.
Appreciate any suggestions you may have.