开发者

Calculate week number within month [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Calculate week of month in .NET

I need to calculate the week number of a given Date within a month. The reason I embolden month is that all the examples (on here and elsehwere) I come across are based on yearly. Basically, I want to see what week number 14/2/2010 comes in (dd/MM/yyyy format). Given a starting day of Monday, I would expect this to return 2.

How aware of Culture do I have to be in this calculation开发者_StackOverflow社区?


This is effectively a duplicate of Get Week of Month in .NET. You need to alter the method GetWeekOfYear shown there to account for the fact that you want your weeks to start on Monday.

This answer intentionally marked Community Wiki.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜