Getting the Name of the Day of the Week in C#
Getting the current day of week in C# is pretty easy, if all you need is the english version of the day, for example:
MessageBox.Show(System.DateTime.Now.DayOfWeek.ToString());
But if you want to get the Day of Week for the current language the computer is setup for, the above code will not work. You need to access the Globalization class and get the day of week from there. The snippet of code below, demonstrates how to do it:
MessageBox.Show(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DayNames[(int)
System.DateTime.Now.DayOfWeek]);