I have the code:
DateTime.Now.DayOfWeek.ToString()
That give's me the english day of the week name, I want to have the german version, how to add CultureInfo here to get the german day of the week name?
var culture = new System.Globalization.CultureInfo("de-DE"); var day = culture.DateTimeFormat.GetDayName(DateTime.Today.DayOfWeek);
You can use the DateTimeFormat.DayNames
property of the german CultureInfo
. For example:
CultureInfo german = new CultureInfo("de-DE"); string sunday = german.DateTimeFormat.DayNames[(int)DayOfWeek.Sunday];
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