Beginning with Windows Server 2012 and Windows 8, the default short date format for English (Canada) was changed from dd/MM/yyyy to yyyy-MM-dd.
Microsoft is not planning to revert this change as yyyy-MM-dd is the recommended date format by The Government of Canada. However, there is no legislation about it so other formats are also used in different contexts.
Workaround
If this format change caused an issue in your application, a quick fix is that changing the date string before using it in the application:
string displayOnPage2 = Calendar1.SelectedDate.ToString("dd/MM/yy");
For CultureInfo class, you can also change the short date pattern:
CultureInfo ci = CultureInfo.CreateSpecificCulture("en-CA");DateTimeFormatInfo dtfi = ci.DateTimeFormat;
dtfi.ShortDatePattern ="dd/MM/yyyy";
string displayOnPage1= Calendar1.SelectedDate.ToString("d", dtfi);
Alternative Solution
You can also solve this issue by changing the server’s Region settings. However, as many developers and system administrators don’t want to change server settings, my recommendation would be making a code change instead as explained above.
Published May 17, 2019
Version 1.0Nedim
Former Employee
Joined November 26, 2018
IIS Support Blog
Follow this blog board to get notified when there's new activity