Get the day of the week, in the right language

I’m working on an app that at some point will need to work in multiple languages and needed to display the day of the week to the user. I started with:

string label = DateTime.Today.DayOfWeek.ToString()

But that give me the name of the enumeration, which is of course in English. In order to get the name based on the current language setting I needed the following code:


var culture = System.Globalization.CultureInfo.CurrentCulture;
string label = culture.DateTimeFormat.GetDayName(DateTime.Today.DayOfWeek);

Happy coding!