Inconsistent UWP DateTimeFormatter output for similar patterns with en-US culture
I'm using Windows.Globalization.DateTimeFormatting.DateTimeFormatter in a UWP app with the culture set to "en-US". I noticed inconsistent formatting between two similar patterns.
Scenario: Pattern: "day month.abbreviated year hour minute" → Output: 03-Jun-25 10:53 AM
Pattern: "day month.abbreviated hour minute" → Output: Jun 3 10:53 AM
Despite both using "day" and "month.abbreviated", the order of components differs depending on whether year is included or not.
Expectation: Both formats should follow a consistent order like MM/dd/yyyy for a given culture ("en-US" in this case).
Ways to Reproduce:
string format1 = "day month.abbreviated year hour minute";
string format2 = "day month.abbreviated hour minute"
DateTimeFormatter formatter1 = new DateTimeFormatter(format1 , new[] { "en-US" });
DateTimeFormatter formatter2 = new DateTimeFormatter(format2 , new[] { "en-US" });
var output1 = formatter1.Format(DateTime.Now);
var output2 = formatter2.Format(DateTime.Now);
UWPs/
CoreWindows are not supported by WASDK. Is this issue reproducible in any generic win32 app? (hwnd, winforms, wpf, WinUI3)?
This is reproducible in WinUI3 since the DateTimeFormatter is a WinRT API
We appreciate your input. Since this relates to UWP and the Windows App SDK targets desktop-based project types, we’ll close this issue as not planned. For guidance on migrating from UWP to Windows App SDK, see: https://learn.microsoft.com/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/migrate-to-windows-app-sdk-ovw