Skip to content

DateTimeFormat for 'fr-CA' culture corrupted on Linux #29494

@mattjohnsonpint

Description

@mattjohnsonpint

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions