HOME

TheInfoList



OR:

The ISO week date system is effectively a
leap week calendar A leap week calendar is a calendar system with a whole number of weeks in a year, and with every year starting on the same weekday. Most leap week calendars are proposed reforms to the civil calendar, in order to achieve a perennial calendar. So ...
system that is part of the
ISO 8601 ISO 8601 is an international standard covering the worldwide exchange and communication of date and time-related data. It is maintained by the Geneva-based International Organization for Standardization (ISO) and was first published in 1988, w ...
date and time standard issued by the
International Organization for Standardization The International Organization for Standardization (ISO ) is an international standard development organization composed of representatives from the national standards organizations of member countries. Membership requirements are given in Art ...
(ISO) since 1988 (last revised in 2019) and, before that, it was defined in ISO (R) 2015 since 1971. It is used (mainly) in
government A government is the system or group of people governing an organized community, generally a state. In the case of its broad associative definition, government normally consists of legislature, executive, and judiciary. Government is ...
and business for
fiscal year A fiscal year (or financial year, or sometimes budget year) is used in government accounting, which varies between countries, and for budget purposes. It is also used for financial reporting by businesses and other organizations. Laws in many ...
s, as well as in timekeeping. This was previously known as "Industrial date coding". The system specifies a ''week year'' atop the
Gregorian calendar The Gregorian calendar is the calendar used in most parts of the world. It was introduced in October 1582 by Pope Gregory XIII as a modification of, and replacement for, the Julian calendar. The principal change was to space leap years dif ...
by defining a notation for ordinal weeks of the year. The Gregorian
leap cycle A leap year (also known as an intercalary year or bissextile year) is a calendar year that contains an additional day (or, in the case of a lunisolar calendar, a month) added to keep the calendar year synchronized with the astronomical year or s ...
, 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 (corresponding to the Gregorian years that contain 53 Thursdays). An average year is exactly 52.1775 weeks long; months ( year) average at exactly weeks. An ISO week-numbering year (also called ''ISO year'' informally) 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 the 1st of January and on leap years that start on Wednesday the 1st. The extra week is sometimes referred to as a ''
leap week A leap week calendar is a calendar system with a whole number of weeks in a year, and with every year starting on the same weekday. Most leap week calendars are proposed reforms to the civil calendar, in order to achieve a perennial calendar. S ...
'', 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 (in extended form) or (in compact form). The ISO year is slightly offset to the Gregorian year; for example, Monday 30 December 2019 in the Gregorian calendar is the first day of week 1 of 2020 in the ISO calendar, and is written as 2020-W01-1 or 2020W011.


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 (which are at the end of the previous ISO year) and a Monday through 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 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 (i.e. of January) 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 (4 or more) 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 (previous Gregorian year) 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 (4 or more) 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 (
dominical letter Dominical letters or Sunday letters are a method used to determine the day of the week for particular dates. When using this method, each year is assigned a letter (or pair of letters for leap years) depending on which day of the week the year sta ...
D or DC) and any leap year ''starting'' on Wednesday ( ED) * any year ''ending'' on Thursday (D, ED) and any leap year ''ending'' on Friday (DC) * years in which 1 January or 31 December are Thursdays 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, p(y), that returns the day of the week of 31 December: :\begin p(y) &= \left(y + \left\lfloor\frac4\right\rfloor - \left\lfloor\frac\right\rfloor + \left\lfloor\frac \right\rfloor \right) \bmod 7\\ \text(y) &= 52 + \begin 1 \text & \text p(y) = 4 \text\\ & \text p(y-1) = 3 \text \\ 0 \text & \text \end \end This can be expressed as a single function without case distinction in different ways, e.g.: :\beginweeks(y) &= 53 - \left\lceil\frac12 \cdot \left( \left\lceil \frac \right\rceil + \left\lceil \frac \right\rceil \right) \right\rceil\\ &= 53 - \left\lceil\frac12 \cdot \left( \left\lceil \frac \right\rceil + \left\lceil \frac \right\rceil \right) \right\rceil\end 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 (between years 296 and 303). The Gregorian years corresponding to these 71 long years can be subdivided as follows: * 27 Gregorian leap years, emphasized in the list above: ** 14 starting on Thursday, hence ending on Friday, and ** 13 starting on Wednesday, hence ending on Thursday; * 44 Gregorian common years starting, hence also ending on Thursday. The Gregorian years corresponding to the other 329 short years (neither starting nor ending with Thursday) 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 (371 − 366). * 44 week years are ''6 days longer'' than the month years (371 − 365). * 70 week years are ''2 days shorter'' than the month years (364 − 366). * 259 week years are ''1 day shorter'' than the month years (364 − 365).


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
year A year or annus is the orbital period of a planetary body, for example, the Earth, moving in its orbit around the Sun. Due to the Earth's axial tilt, the course of a year sees the passing of the seasons, marked by change in weather, the hou ...
s. Therefore, a fixed length of 13 weeks per
quarter A quarter is one-fourth, , 25% or 0.25. Quarter or quarters may refer to: Places * Quarter (urban subdivision), a section or area, usually of a town Placenames * Quarter, South Lanarkshire, a settlement in Scotland * Le Quartier, a settlement ...
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. They 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.


Dates with fixed week number

For all years, 8 days have a fixed ISO week number (between W01 and W08) in January and February. With the exception of leap years starting on Thursday, dates with fixed week numbers occur in all months of the year (for 1 day of each ISO week W01 to W52). During leap years starting on Thursday (i.e. the 13 years numbered 004, 032, 060, 088, 128, 156, 184, 224, 252, 280, 320, 348, 376 in a 400-year cycle), the ISO week numbers are incremented by 1 from March to the rest of the year. This last occurred in 1976 and 2004, and will next occur in 2032. These exceptions are happening between years that are most often 28 years apart, or 40 years apart for 3 pairs of successive years: from year 088 to 128, from year 184 to 224, and from year 280 to 320. The day of the week for these days are related to the "Doomsday" algorithm, which calculates the weekday that the last day of February falls on. The dates listed in the table are all one day after the Doomsday, except that in January and February of leap years the dates themselves are Doomsdays. In leap years, the week number is the rank number of its Doomsday.


Equal weeks

Some pairs and triplets of ISO weeks have the same days of the month: * W02 and W41 in common years * W03 with W42 in common years and with W15 and W28 in leap years * W04 and W43 in common years and with W16 and W29 in leap years * W05 and W44 in common years * W06 with W10 and W45 in common years and with W32 in leap years * W07 with W11 and W46 in common years and with W33 in leap years * W08 with W12 and W47 in common years and with W34 in leap years * W10 and W45 * W11 and W46 * W12 and W47 * W15 and W28 * W16 and W29 * W37 and W50 * W38 and W51 Some other weeks, i.e. W09, W19 through W26, W31 and W35 never share their days of the month ordinals with any other week of the same year.


Advantages

* All weeks have exactly 7 days, i.e. there are no fractional weeks. * Every week belongs to a single year, i.e. there are no ambiguous or double-assigned weeks. * The date directly tells the weekday. * All week-numbering years start with a Monday and end with a Sunday. * When used by itself without using the concept of month, all week-numbering years are the same except that some years have a week 53 at the end. * The weeks are the same as used with the Gregorian calendar.


Differences to other calendars

Solar astronomic phenomena, such as
equinox A solar equinox is a moment in time when the Sun crosses the Earth's equator, which is to say, appears directly above the equator, rather than north or south of the equator. On the day of the equinox, the Sun appears to rise "due east" and se ...
es and
solstice A solstice is an event that occurs when the Sun appears to reach its most northerly or southerly excursion relative to the celestial equator on the celestial sphere. Two solstices occur annually, around June 21 and December 21. In many countr ...
s, vary in the Gregorian calendar over a range spanning three days, over the course of each 400-year cycle, while the ISO Week Date calendar has a range spanning 9 days. For example, there are March equinoxes on 1920-W12-6 and 2077-W11-5 in UT. The year number of the ISO week very often differs from the Gregorian year number for dates close to 1 January. For example, 29 December 1986 is ISO 1987-W01-1, i.e., it is in year 1987 instead of 1986. A programming bug confusing these two year numbers is probably the cause of some Android users of
Twitter Twitter is an online social media and social networking service owned and operated by American company Twitter, Inc., on which users post and interact with 280-character-long messages known as "tweets". Registered users can post, like, and ...
being unable to log in around midnight of 29 December 2014 UTC. The ISO week calendar relies on the
Gregorian calendar The Gregorian calendar is the calendar used in most parts of the world. It was introduced in October 1582 by Pope Gregory XIII as a modification of, and replacement for, the Julian calendar. The principal change was to space leap years dif ...
, which it augments, to define the new year day (Monday of week 01). As a result, extra weeks are spread across the 400-year cycle in a complex, seemingly random pattern. (However, a relatively simple algorithm to determine whether a year has 53 weeks from its ordinal number alone is shown under "Weeks per year" above.) Most
calendar reform Calendar reform or calendrical reform is any significant revision of a calendar system. The term sometimes is used instead for a proposal to switch to a different calendar design. Principles The prime objective of a calendar is to unambiguo ...
proposals using leap week designs strive to simplify and harmonize this pattern, some by choosing a different
leap cycle A leap year (also known as an intercalary year or bissextile year) is a calendar year that contains an additional day (or, in the case of a lunisolar calendar, a month) added to keep the calendar year synchronized with the astronomical year or s ...
(e.g. 293 years). Not all parts of the world consider the week to begin with Monday. For example, in some Muslim countries, the normal work week begins on Saturday, while in Israel it begins on Sunday. In much of the Americas, although the work week is usually defined to start on Monday, the calendar week is often considered to start on Sunday.


Algorithms


Calculating the week number from an ordinal date

The week number (WW or ''woy'' for ''week of year'') of any date can be calculated, given its
ordinal date An ordinal date is a calendar date typically consisting of a ''year'' and a day of the year or ordinal day number (or simply ordinal day or day number), an ordinal number ranging between 1 and 366 (starting on January 1), though year may someti ...
(i.e. day of the year, ''doy'' or DDD, 1–365 or 366) and its
day of the week In many languages, the names given to the seven days of the week are derived from the names of the classical planets in Hellenistic astronomy, which were in turn named after contemporary deities, a system introduced by the Sumerians and late ...
(D or ''dow'', 1–7). When using serial numbers for dates (e.g. in spreadsheets), ''doy'' is the serial number for a date minus the serial number for 31st December of the previous year, or alternatively minus the serial number for 1st January the same year plus one. ; Algorithm # Subtract the weekday number from the ordinal day of the year. # Add 10. # Divide by 7, discard the remainder. #* If the week number thus obtained equals 0, it means that the given date belongs to the preceding (week-based) year. #* If a week number of 53 is obtained, one must check that the date is not actually in week 1 of the following year. ; Formula :\begin y &= \text\,(date)\\ w &= \left\lfloor \frac \right\rfloor \\ \text(date) &= \begin \text(y-1), & \textw<1 \\ 1, & \textw>\text(y) \\ w, & \text \end \\ \text(date) &\in , 53\\ \text(date) &\in , 366\\ \text(date) &\in
, 7 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
\ \text(year) &\in 2, 53\ \end


Calculating the week number from a month and day of the month

If the ordinal date is not known, it can be computed from the month (MM or ''moy'') and day of the month (DD or ''dom'') by any of several methods; e.g. using a table such as the following. ; Example : Find the week number of Saturday 5th November 2016 (leap year): :* Find the ordinal day number first: ''moy'' = 11 ''dom'' = 5 ''leap'' = 1 ''add'' = 305, from table lookup ''doy'' = 305 + 5 = 310. :* Alternatively, use spreadsheet serial day numbers instead: ''off'' = 42369, i.e. 31st December 2015 ''day'' = 42679 ''doy'' = 42679 − 42369 = 310. :* Finally, find the week number: ''dow'' = 6, i.e. Saturday ''woy'' = (10 + 310 − 6) div 7 ''woy'' = (320 − 6) div 7 ''woy'' = 314 div 7 = 44.


Calculating an ordinal or month date from a week date

;Algorithm # Multiply the week number by 7. # Then add the weekday number. # From this sum subtract the correction for the year: #* Get the weekday of 4 January. #* Add 3. # The result is the ordinal date, which can be converted into a calendar date. #* If the ordinal date thus obtained is zero or negative, the date belongs to the previous calendar year; #* if it is greater than the number of days in the year, it belongs to the following year. ;Formula :\begin y &= \text(date)\\ d &= \text(date) \times 7 + \text(date) - (\text(y, 1, 4) + 3) \\ \text(date) &= \begin d + \text(y-1), & \textd < 1 \\ d - \text(y), & \textd > \text(y)\\ d, & \text \end \\ \text(year) &\in 65, 366\ \end


Other week numbering systems

The US system has weeks from Sunday through Saturday, and partial weeks at the beginning and the end of the year, i.e. 52 full and 1 partial week of 1 or 2 days if the year starts on Sunday or ends on Saturday, 52 full and 2 single-day weeks if a leap year starts on Saturday and ends on Sunday, otherwise 51 full and 2 partial weeks. An advantage is that no separate year numbering like the ISO year is needed. Correspondence of lexicographical order and chronological order is preserved (just like with the ISO year-week-weekday numbering), but partial weeks make some computations of weekly statistics or payments inaccurate at the end of December or the beginning of January or both. The US
broadcast calendar The broadcast calendar is a standardized calendar used primarily for the planning and purchase of radio and television programs and advertising. Every week in the broadcast calendar starts on a Monday and ends on a Sunday, and every month has ei ...
designates the week containing 1 January (and starting Monday) as the first of the year, but otherwise works like ISO week numbering without partial weeks. Up to six days of the previous December may be part of the first week of the year. A mix of those, wherein weeks start Sunday and "containing 1 January" defines the first week, is used in US accounting, resulting in a system with years having also 52 or 53 weeks.


References


External links


The Mathematics of the ISO 8601 Calendar
{{calendars Weeks Calendaring standards Leap week calendars Specific calendars