i want to find number of week days and weekend days between two using asp.net?

Take a look at the TimeSpan structure. You can use it to determine the difference between two dates. It won't directly give you the number of weekend days and weekdays but knowing the starting day, you should be able to figure out the rest.

Example:

If I start today (Wednesday - 2009/07/29) and know the end is 3 weeks (21 days), I can programmatically determine the number of whole weeks in the timespan (in my case 3). Knowing that, I have 15 weekdays and 6 weekend days. If I had a remainder of days (say it was 25 days), I'd only need to programmatically determine the remainder days for the type.
 
Back
Top