Are there built-in Month name declensions in C#

You can obtain months’ names in two cases, Nominative:

DateTimeFormatInfo info = CultureInfo.GetCultureInfo("ru-RU").DateTimeFormat;

// February: 2 - 1 (array is zero based) - "Февраль"
Console.Write(info.MonthNames[2 - 1]);

And Genitive:

// February: 2 - 1 (array is zero based) - "февраля"
Console.Write(info.MonthGenitiveNames[2 - 1]);

Other cases (e.g. Dative, Accusative) are not supported and we have to implement them manually.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)