Consider the following:
var culture = CultureInfo.GetCultureInfo("fr-CA");
Console.WriteLine($"ShortDatePattern: {culture.DateTimeFormat.ShortDatePattern}");
Console.WriteLine($"ShortTimePattern: {culture.DateTimeFormat.ShortTimePattern}");
Console.WriteLine($"LongDatePattern: {culture.DateTimeFormat.LongDatePattern}");
Console.WriteLine($"LongTimePattern: {culture.DateTimeFormat.LongTimePattern}");
Console.WriteLine(DateTime.Now.ToString(culture));
Running on .NET Core (I tested 2.1 and 2.2) on Linux (Ubuntu 18.04.1 LTS) returns:
ShortDatePattern: yy-MM-dd
ShortTimePattern: HH h mm
LongDatePattern: dddd d MMMM yyyy
LongTimePattern: HH h mm m ss s
19-05-09 12 12 23 23 07 7
Both the short and long time patterns are corrupted. CLDR charts show the short time pattern should be HH 'h' mm, and the long time pattern should be HH 'h' mm 'min' ss 's'.
It appears the single quotes are being removed, and 'min' is being truncated to m.
This ends up with strange time output in the DateTime.ToString for this culture, as reported on Stack Overflow.
@tarekgh
Consider the following:
Running on .NET Core (I tested 2.1 and 2.2) on Linux (Ubuntu 18.04.1 LTS) returns:
Both the short and long time patterns are corrupted. CLDR charts show the short time pattern should be
HH 'h' mm, and the long time pattern should beHH 'h' mm 'min' ss 's'.It appears the single quotes are being removed, and
'min'is being truncated tom.This ends up with strange time output in the
DateTime.ToStringfor this culture, as reported on Stack Overflow.@tarekgh