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
C# – Return index value datetime.now.dayofweek but how
.netc++datetime
Related Question
- C# – How to enumerate an enum
- Sql – How to return only the Date from a SQL Server DateTime datatype
- Javascript – How to get a timestamp in JavaScript
- C# – Path.Combine for URLs
- Python – How to get the current time in Python
- C# – Case insensitive ‘Contains(string)’
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- C# – Why not inherit from List
Best Solution
This little one-liner works independent of locale, with always Friday == 5