Please enable JavaScript to view this site.

 

int = NumWeeksInMonth(nYear, nMonth, bFullWeeks, nWeekStart)

 

This macro function returns the number of weeks contained in month nMonth in year nYear.

 

bFullWeeks indicates if the function should return number of full weeks, or the number of weeks, even if some are partial.

nWeekStart ranges from 1 (Monday) to 7 (Sunday), and defines the beginning of the week.

 

In the examples on the right, with nWeekStart = 7.

 

If bFullWeeks = true, then the number of weeks for March is 4, and the number for April is 3.

If bFullWeeks = false, then the number of weeks for March is 6, and the number for April is 5.

 

See also: NumDaysInMonth.

 


Topic 110114, last updated on 20-May-2020