Asked By TAB
16-Sep-08 03:12 PM

It's been a long time since I worked with this so I have to quote
Wikipedia on ISO 8601 regarding week numbers.
The ISO year number deviates from the number of the Gregorian year on, if
applicable, a Friday, Saturday, and Sunday, or a Saturday and Sunday, or
just a Sunday, at the start of the Gregorian year (which are at the end of
the previous ISO year) and a Monday, Tuesday and Wednesday, or a Monday and
Tuesday, or just a Monday, at the end of the Gregorian year (which are in
week 01 of the next ISO year). In the period 4 January-28 December and on
all Thursdays the ISO year number is always equal to the Gregorian year
number.
Mutually equivalent definitions for week 01 are:
the week with the year's first Thursday in it
the week starting with the Monday which is nearest in time to 1 January
the week with the year's first working day in it (if Saturdays, Sundays, and
1 January are not working days)
the week with January 4 in it
the first week with the majority (four or more) of its days in the starting
year
the week starting with the Monday in the period 29 December - 4 January
the week with the Thursday in the period 1 - 7 January
If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in week
01. If 1 January is on a Friday, Saturday or Sunday, it is in week 52 or 53
of the previous year.
Note that while most definitions are symmetric with respect to time
reversal, one definition in terms of working days happens to be equivalent.
The last week of the ISO year is the week before week 01; in accordance with
the symmetry of the definition, equivalent definitions are:
the week with the year's last Thursday in it
the week ending with the Sunday which is nearest in time to 31 December
the week with December 28 in it
the last week with the majority (four or more) of its days in the ending
year
the week starting with the Monday in the period 22 - 28 December
the week with the Thursday in the period 25 - 31 December
the week ending with the Sunday in the period 28 December - 3 January
If 31 December is on a Monday, Tuesday, or Wednesday, it is in week 01 of
the next year, otherwise in week 52 or 53.
The following years have 53 weeks:
years starting with Thursday
leap years starting with Wednesday