is there any function of datetime return dayofweekindex? such as:
int Todaywhat_is_Index= = DateTime.Now.IndexOfDayofThisWeek;
if Today is friday, it must be return 5
ifToday is Saturday, it must be return 6
ifToday is Sunday, it must be return 0
is there any function of datetime return dayofweekindex? such as: int Todaywhat_is_Index= = DateTime.Now.IndexOfDayofThisWeek;
Share
Yes, check DateTime.DayOfWeek.
Please note this depends on the regional settings (here in Europe Monday is the first day of the week).