Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To check weekday of a month

Tags:

date

c#

calendar

I have a date such as April,1,2009. I want to know what the weekday is, i.e. whether April 1 is a Monday, Tuesday etc. Likewise I want to check weekday of each day in the month of April.

like image 650
user42348 Avatar asked Dec 17 '22 08:12

user42348


2 Answers

You can use the DayOfWeek property.

like image 134
Zhaph - Ben Duguid Avatar answered Jan 01 '23 17:01

Zhaph - Ben Duguid


Use the DayOfWeek property:

new DateTime(2009, 4, 1).DayOfWeek
like image 30
Jon Skeet Avatar answered Jan 01 '23 17:01

Jon Skeet