tags:

views:

158

answers:

1

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?

A: 

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.

Jason
Thanks, Jason. Sorry for the dupe. I guess I was searching on "Calculate" instead of "Get". Also search in list of potentials in subject but no match.
Program.X
@Program.X: You're welcome. Yes, that's a bad title for that question. I'll fix.
Jason