get_week_numbering_year


Description:

public int get_week_numbering_year ()

Returns the ISO 8601 week-numbering year in which the week containing this falls.

This function, taken together with get_week_of_year and get_day_of_week can be used to determine the full ISO week date on which this falls.

This is usually equal to the normal Gregorian year (as returned by get_year) , except as detailed below:

For Thursday, the week-numbering year is always equal to the usual calendar year. For other days, the number is such that every day within a complete week (Monday to Sunday) is contained within the same week-numbering year.

For Monday, Tuesday and Wednesday occurring near the end of the year, this may mean that the week-numbering year is one greater than the calendar year (so that these days have the same week-numbering year as the Thursday occurring early in the next year).

For Friday, Saturday and Sunday occurring near the start of the year, this may mean that the week-numbering year is one less than the calendar year (so that these days have the same week-numbering year as the Thursday occurring late in the previous year).

An equivalent description is that the week-numbering year is equal to the calendar year containing the majority of the days in the current week (Monday to Sunday).

Note that January 1 0001 in the proleptic Gregorian calendar is a Monday, so this function never returns 0.

Parameters:

this

a DateTime

Returns:

the ISO 8601 week-numbering year for this