How to extract the day of the week from a specific date in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        DateTime adate = new DateTime(2020, 8, 24);
        
        Console.WriteLine((int)adate.DayOfWeek);
        Console.WriteLine(adate.DayOfWeek);
    }
}



/*
run:

1
Monday

*/

 



answered Oct 8, 2020 by avibootz
...