Quote:
The value of the constants in the DayOfWeek enumeration ranges from DayOfWeek.Sunday to DayOfWeek.Saturday. If cast to an integer, its value ranges from zero (which indicates DayOfWeek.Sunday) to six (which indicates DayOfWeek.Saturday).
Read the Remarks section of the
DateTime.DayOfWeek Property[
^]
if you need Day number of the week
var daynumber = ((int)dateTime.DayOfWeek) +1;
Side Note: Your code can reduce to
int dayNum = (int)DateTime.Today.AddDays(7).DayOfWeek + 1;