ISO week date


The ISO week date system is effectively a leap week calendar system that is part of the ISO 8601 date and time standard issued by the International Organization for Standardization since 1988 and, before that, it was defined in ISO 2015 since 1971. It is used in government and business for fiscal years, as well as in timekeeping. This was previously known as "Industrial date coding". The system specifies a week year atop the Gregorian calendar by defining a notation for ordinal weeks of the year.
The Gregorian leap cycle, which has 97 leap days spread across 400 years, contains a whole number of weeks. In every cycle there are 71 years with an additional 53rd week. An average year is exactly 52.1775 weeks long; months average at exactly 4.348125 weeks/month.
An ISO week-numbering year has 52 or 53 full weeks. That is 364 or 371 days instead of the usual 365 or 366 days. These 53-week years occur on all years that have Thursday as 1 January and on leap years that start on Wednesday. The extra week is sometimes referred to as a leap week, although ISO 8601 does not use this term.
Weeks start with Monday and end on Sunday. Each week's year is the Gregorian year in which the Thursday falls. The first week of the year, hence, always contains 4 January. ISO week year numbering therefore usually deviates by 1 from the Gregorian for some days close to 1 January.
A precise date is specified by the ISO week-numbering year in the format YYYY, a week number in the format ww prefixed by the letter 'W', and the weekday number, a digit d from 1 through 7, beginning with Monday and ending with Sunday. For example, the Gregorian date, corresponds to day number in the week number of, and is written as or . The ISO year is slightly offset to the Gregorian year; for example, Monday 30 December 2024 in the Gregorian calendar is the first day of week 1 of 2025 in the ISO calendar, and is written as 2025-W01-1 or 2025W011.

Relation with the Gregorian calendar

The ISO week year number deviates from the Gregorian year number in one of three ways. The days differing are a Friday through Sunday, or a Saturday and Sunday, or just a Sunday, at the start of the Gregorian year and a Monday through Wednesday, or a Monday and Tuesday, or just a Monday, at the end of the Gregorian year. In the period 4 January to 28 December the ISO week year number is always equal to the Gregorian year number. The same is true for every Thursday.

First week

The ISO 8601 definition for week 01 is the week with the first Thursday of the Gregorian year in it.
The following definitions based on properties of this week are mutually equivalent, since the ISO week starts with Monday:
  • It is the first week with a majority of its days in January.
  • Its first day is the Monday nearest to 1 January.
  • It has 4 January in it. Hence the earliest possible first week extends from Monday 29 December to Sunday 4 January, the latest possible first week extends from Monday 4 January to Sunday 10 January.
  • It has the year's first working day in it, if Saturdays, Sundays and 1 January are not working days.
If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in W01.
If it is on a Friday, it is part of W53 of the previous year.
If it is on a Saturday, it is part of the last week of the previous year which is numbered W52 in a common year and W53 in a leap year.
If it is on a Sunday, it is part of W52 of the previous year.
'''Notes'''

Last week

The last week of the ISO week-numbering year, i.e. W52 or W53, is the week before W01 of the next year.
This week's properties are:
  • It has the year's last Thursday in it.
  • It is the last week with a majority of its days in December.
  • Its middle day, Thursday, falls in the ending year.
  • Its last day is the Sunday nearest to 31 December.
  • It has 28 December in it.
Hence the earliest possible last week extends from Monday 22 December to Sunday 28 December, the latest possible last week extends from Monday 28 December to Sunday 3 January.
If 31 December is on a Monday, Tuesday, or Wednesday it is in W01 of the next year.
If it is on a Thursday, it is in W53 of the year just ending.
If on a Friday it is in W52 of the year just ending in common years and W53 in leap years.
If on a Saturday or Sunday, it is in W52 of the year just ending.

Weeks per year

The long years, with 53 weeks in them, can be described by any of the following equivalent definitions:
  • any year starting on Thursday and any leap year starting on Wednesday
  • any year ending on Thursday and any leap year ending on Friday
  • years in which 1 January or 31 December is a Thursdays, or both are
All other week-numbering years are short years and have 52 weeks.
The number of weeks in a given year is equal to the corresponding week number of 28 December, because it is the only date that is always in the last week of the year since it is a week before 4 January which is always in the first week of the following year.
Using only the ordinal year number y, the number of weeks in that year can be determined from a function,, that returns the day of the week of 31 December:
Subcycle+6+5+6+5+6
281004009015020026
282032037043048054
283060065071076082
401088093099
401105111116122
284128133139144150
285156161167172178
402184189195
402201207212218
286224229235240246
287252257263268274
403280285291296
403303308314
288320325331336342
289348353359364370
2810376381387392398

On average, a year has 53 weeks every = 5.6338... years; there are 43 times when these long years are 6 years apart, 27 times when they are 5 years apart, and once they are 7 years apart.
The Gregorian years corresponding to these 71 long years can be subdivided as follows:
The Gregorian years corresponding to the other 329 short years can also be subdivided as follows:
  • 70 are Gregorian leap years.
  • 259 are Gregorian common years.
Thus, within a 400-year cycle:
  • 27 week years are 5 days longer than the month years, 6.75%.
  • 44 week years are 6 days longer than the month years, 11%.
  • 70 week years are 2 days shorter than the month years, 17.5%.
  • 259 week years are 1 day shorter than the month years, 64.75%.
The table shows the long years in a 400-year cycle. There are 28 years, i.e. a Julian solar cycle, between long years in the same column except when the century changes, when there are 40 years between the long years in the next century and the last completely filled row of the previous century.
There are ten regular subcycles of 28 years each and three subcycles of 40 years each.
The 40-year subcycles 085–124 and 181–220 are equal, but the middle long year within the subcycle 277–316 would have to occur in 297 instead of 296 to be also the same. This illustrates the only, abnormal 7-year gap between long years.

Weeks per month

The ISO standard does not define any association of weeks to months. A date is either expressed with a month and day-of-the-month, or with a week and day-of-the-week, never a mix.
Weeks are a prominent entity in accounting where annual statistics benefit from regularity throughout the years. Therefore, a fixed length of 13 weeks per quarter is usually chosen in practice. These quarters may then be subdivided into 5 + 4 + 4 weeks, 4 + 5 + 4 weeks or 4 + 4 + 5 weeks. The final quarter has 14 weeks in it when there are 53 weeks in the year.
When it is necessary to allocate a week to a single month, the rule for first week of the year might be applied, although ISO 8601-1 does not consider this case explicitly. The resulting pattern would be irregular. There would be 4 months of 5 weeks per normal, 52-week year, or 5 such months in a long, 53-week year. Although the days of a month always belong to 5 and sometimes 6 different weeks, there would never be 6 weeks belonging to a single month.
The 5-week months would meet one of the following three criteria:
  • The first day of the month is a...
  • * Thursday and the month has 29 through 31 days.
  • * Wednesday and the month has 30 or 31 days.
  • * Tuesday and the month has 31 days, ending on a Thursday.
  • Equivalently, the last day of the month is a...
  • * Thursday and it is not the 28th.
  • * Friday and it is not in February.
  • * Saturday and it is the 31st.