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.

 

•If bFullWeeks is true, count only weeks whose seven days all fall within the month. If it is false, count every week containing at least one day of the month, including partial weeks. Both counts use nWeekStart to define the week boundaries.

•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 14-Oct-2026