With following code I get the following result in de-CH culture:
var dateFormat = new DateTime(2016, 10, 12).ToString("MMMM");
//Oktober
Though what I really want is "Oktobär" because I am translating into a dialect.
Can I override which month names are returned in de-CH culture? The names that it returns for other cultures should stay the same.
CultureInfo myCIclone = new CultureInfo("de-CH");
myCIclone.DateTimeFormat.MonthNames = new string[]
{"1","2","3","4","5","6","7","8","9","Oktobär","11","12", "13"};
var dateFormat = new DateTime(2016, 10, 12).ToString("MMMM", myCIclone);
You can override the MonthNames like John Skeet mentioned, for specific culture info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With