C# Program to get current day of week


Use DateTime. DayOfWeek property to display the current day of week.

DayOfWeek wk = DateTime.Today.DayOfWeek;

Now, displaying “wk” would give you the current day of the week.

Let us see the complete code to get the current day of week.

Example

 Live Demo

using System;
using System.Linq;
public class Demo {
   public static void Main() {
      DayOfWeek wk = DateTime.Today.DayOfWeek;
      Console.WriteLine(wk);
   }
}

Output

Wednesday

Updated on: 23-Jun-2020

12K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements