3

is there any standard way to associate a ISO week number with a specific month?

Let's say we have week 35 this year (from 08/29/2011 to 09/04/2011), does this week belong to August or September?

I'm looking for a standard or the most common way of doing it.

Why I need this is for some statistics. Something like: sum earnings of every first week in month for the last 5 months.

1 Answers1

5

The first iso_week contains the first thursday of the year, so it is a consistent practice to define the month of the iso week as that which contains the thursday (day 4) of the week.

iso_date = (iso_year, iso_week, 4)

convert to common date and extract the month.

That way you make sure that the first iso_week of a year belongs to january, and the last iso_week of a year belongs to december.

cgw
  • 66