Click here to Skip to main content
16,021,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In looking at each month, all months have different starting dates. Are there any rules and/or standards, out on the WWW, that helps in determining what is "the correct" Week Number one for any given month. Hum...
Any help would be greatly appreciated. Thanks,

What I have tried:

Implimenting my own definition of what is the months first week is. I'm looking for a more normal definition on the subject.
Posted
Updated 5-Jul-24 16:47pm

ISO (in 8601 for instance) defines the first week of the year as the first week with more days in the new year than in the previous one.

I don't think I've ever heard of anyone determining the first week of a month, but I recommend following the same logic. So, the week which contains the fourth of the month, or the week which contains the first Thursday.
 
Share this answer
 
I have not yet seen a specific standard that regulates the assignment of calendar weeks to months. ISO 8601 defines the calendar week on an annual basis, but not explicitly on a monthly basis. To ensure consistency, a week could be derived from the calendar week defined in ISO 8601:
- A week starts on Monday.
- The first week of the year is the week that contains the first Thursday of the year.

In practice, three methods could be used to assign weeks to months:

Majority principle:
The week is assigned to the month containing the majority of days in that week.

First day of the week:
The week is assigned to the month in which the first day of that week falls.

Last day of the week:
The week is assigned to the month in which the last day of that week falls.

I suspect that there may be slight differences in different countries.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900