开发者

How to get weekends between two dates? [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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜