Click here to Skip to main content
15,888,286 members
Articles / Web Development / ASP.NET

Find the count of a weekday between two dates without iterating/looping

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
11 Nov 2011CPOL 7.7K  
Is it easier to start from the next targeted day? Subtract that date from the end date. If the result is negative, return 0 otherwise return the quotient of the difference in days between the two dates divided by 7 plus 1.public static int findWeekCount(DateTime startDate, DateTime toDate,...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Wales Wales
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions