开发者

How to get weekends between two dates? [duplicate]

开发者 https://www.devze.com 2023-03-09 13:46 出处:网络
This question already has answers here:开发者_开发技巧 Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_开发技巧 Closed 11 years ago.

Possible Duplicate:

Calculate the number of weekdays between two dates in C#

Is there a method to know how much saturdays and sundays there are between two dates? for example: 13/01/2011 to 28/02/2011 result will be: 3 saturdays and 3 sundays

can someone help please? thank you in advance


You could traverse through days between the two dates and for each day check it against saturday and sunday. Datetime conains DayOfWeek.

0

精彩评论

暂无评论...
验证码 换一张
取 消