user42348
user42348

Reputation: 4319

To check weekday of a month

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.

Upvotes: 4

Views: 1535

Answers (3)

Alnitak
Alnitak

Reputation: 339786

If your computer language of choice doesn't have a DayOfWeek function, you can use Zeller's Congruence which returns the day of the week using simple integer arithmetic.

Upvotes: 0

Zhaph - Ben Duguid
Zhaph - Ben Duguid

Reputation: 26956

You can use the DayOfWeek property.

Upvotes: 6

Jon Skeet
Jon Skeet

Reputation: 1499950

Use the DayOfWeek property:

new DateTime(2009, 4, 1).DayOfWeek

Upvotes: 6

Related Questions