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:
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 DayNames
property on the DateTimeFormatInfo
class and get the day of week from there. The snippet of code below, demonstrates how to do it: