In Australia, A client has been entering "1/5"
as a shortcut for the first day of May. We have just moved from Windows Server 2008 to Windows Server 2012.
Using the following code in LinqPad:
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-au", false);
System.Globalization.DateTimeFormatInfo.CurrentInfo.MonthDayPattern.Dump();
DateTime.Parse("1/5").Dump();
On Windows Server 2008:
dd MMMM
1/05/2016 12:00:00 AM
On Windows Server 2012 R2:
MMMM d
5/01/2016 12:00:00 AM
Questions:
- Why has the MonthDayPattern changed? Australians always have day first, then month
- Where can this be set in the Windows Server UI? The UI only exposes the long and short formats, not the month and day format
- How can I fix the issue in my application with the least amount of changes, given that there could be
DateTime.Parse
happening all through the system (Eg. Model Binding, Validation etc)