Im need to calculate the numbers of the weeks of the past month. If I’m in April, I need to know the number of every week of March. Is not just one week, I need all of the numbers.
Ej. If the month is January, the weeks of year will be 1 , 2 , 3 and 4. (If january has four weeks) And february numbers will be 5, 6, 7 and 8.
Let me know if you know how to solve this problem.
Hi @lakshman thank you, I’ve had it already. The problem is that I need to GetWeekOfYear of every week of last month. I don’t know where to start to generate the resutls.
I would suggest build on @lakshman idea to just get the first and the last day of the last month new DateTime(dateNow.Year, DateNow.AddMonths(-1).Month,1) FirstDayLastMonth.AddMonths(1).AddDays(-1)
Then get for both of the the GetWeekOfYear then you will have the start and end weeks for your interval and can build a little array with this information.