Last night we migrated our web services tier from physical Windows 2008 r2 to virtual Windows 2012.
We are getting tons of events on ours logs about DateTime's invalid formats, strange as we double checked our regional settings.
Long story short:
CultureInfo.GetCultureInfo("es-MX").DateTimeFormat.AbbreviatedMonthNames
Outputs (using LinqPad5):
- ene.
- feb.
- mar.
on our new 2012 env while on 2008 ouptus:
- ene
- feb
- mar
Our parsing is something like this:
DateTime.Parse("18 ene 16",CultureInfo.GetCultureInfo("es-MX"))
And while it worked wonders now it throws
FormatException :
The string was not recognized as a valid DateTime. There is an unknown word starting at index 3.
.
While
DateTime.Parse("18 ene. 16",CultureInfo.GetCultureInfo("es-MX"))
works but isn't the expected input from our several clients.
Working on the same runtime version (4.0.30319.42000), double checked (again) our regional settings on both servers what else can I look for to fix this (before giving up and hacking it with a regex replace)?
Thanks.