Blog Post

IIS Support Blog
1 MIN READ

The default short date format for English (Canada)

Nedim's avatar
Nedim
Iron Contributor
May 17, 2019

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.0

1 Comment

  • taehee51's avatar
    taehee51
    Copper Contributor

    Will 24-hour time be default? The Canadian government recommends 24-hour times as well for both English and French