ISO week date

Last updated
Current week expressed according to ISO 8601 [ refresh ]
Date 2024-12-17
Week2024-W51
Week with weekday2024-W51-2

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 (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 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.

Contents

The Gregorian leap cycle, which has 97 leap days spread across 400 years, contains a whole number of weeks (20871). 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 (112 year) average at exactly 4.348125 weeks/month.

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 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.

Examples of contemporary dates around New Year's Day
English shortISO
Sat 1 Jan 20052005-01-012004-W53-6
Sun 2 Jan 20052005-01-022004-W53-7
Sat 31 Dec 20052005-12-312005-W52-6
Sun 1 Jan 20062006-01-012006-W52-7
Mon 2 Jan 20062006-01-022006-W01-1
Sun 31 Dec 20062006-12-312006-W52-7
Mon 1 Jan 20072007-01-012007-W01-1
Sun 30 Dec 20072007-12-302007-W52-7
Mon 31 Dec 20072007-12-312008-W01-1
Tue 1 Jan 20082008-01-012008-W01-2
Sun 28 Dec 20082008-12-282008-W52-7
Mon 29 Dec 20082008-12-292008-W01-1
Tue 30 Dec 20081980-12-302009-W01-2
Wed 31 Dec 20082008-12-312009-W01-3
Thu 1 Jan 20092009-01-012009-W01-4
Thu 31 Dec 20092009-12-312009-W53-4
Fri 1 Jan 20102010-01-012009-W53-5
Sat 2 Jan 20102010-01-022009-W53-6
Sun 3 Jan 20102010-01-032009-W53-7
Notes:
  • Both years 2007 and 2007W start with the same day.
  • 2008 is a leap year. 2008W is 2 days shorter:
    • 1 day longer at the start,
    • 3 days shorter at the end.
  • 2009W begins three days before the end of 2008.
  • 2009W has 53 weeks and ends three days into 2010.

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 Tuesday, 17 December 2024 corresponds to day number 2 in the week number 51 of 2024, and is written as 2024-W51-2 (in extended form) or 2024W512 (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:

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.

Week date peculiarities at the beginning and end of a year
Dominical
letter
[a]
Days at the start of JanuaryEffectDays at the end of December [a]
1
Mo
2
Tu
3
We
4
Th
5
Fr
6
Sa
7
Su
W01-1 [b] Week of
01 Jan
...Week of
31 Dec [a]
1 [c]
Mo
2
Tu
3
We
4
Th
5
Fr
6
Sa
7
Su
G (F)0102030405060701 JanW01...W0131 (30) (31)
F (E)01020304050631 Dec30 (29)31 (30) (31)
E (D)010203040530 DecW01 (W53)29 (28)30 (29)31 (30) (31)
D(C)0102030429 DecW5328 (27)29 (28)30 (29)31 (30) (31)
C (B)01020304 JanW53W5227 (26)28 (27)29 (28)30 (29)31 (30) (31)
B (A)010203 JanW52 (W53) [d] 26 (25)27 (26)28 (27)29 (28)30 (29)31 (30) (31)
A (G)0102 JanW52W52 (W01)25 (31)26 (25)27 (26)28 (27)29 (28)30 (29)31 (30)

Notes

  1. 1 2 3 Partial dates in parentheses, ( ), apply to leap years.
  2. First date of the first week in the year.
  3. First date of the last week in the year.
  4. W53 for the week of 1 January in common years starting on Saturday (B) applies only if the previous year was a leap year starting on Thursday (DC).

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:

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.

Summary of last weeks
01 JanW01-1Common year (365 − 1 or + 6)Leap year (366 − 2 or + 5)
Mon01 JanG+0−1GF+0−2
Tue31 DecF+1−2FE+1−3
Wed30 DecE+2−3ED+2+3
Thu29 DecD+3+3DC+3+2
Fri04 JanC−3+2CB−3+1
Sat03 JanB−2+1BA−2+0
Sun02 JanA−1+0AG−1−1

Weeks per year

The long years, with 53 weeks in them, can be described by any of the following equivalent definitions:

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: [1]

Long years per 400-year leap-cycle, highlighted ones also have 29 Feb in them; adding 2000 gives current year numbers
Subcycle+6+5+6+5+6
281004009015020026
282032037043048054
283060065071076082
401088093099
105111116122
284128133139144150
285156161167172178
402184189195
201207212218
286224229235240246
287252257263268274
403280285291296
303308314
288320325331336342
289348353359364370
2810376381387392398

On average, a year has 53 weeks every 40071 = 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:

The Gregorian years corresponding to the other 329 short years (neither starting nor ending with Thursday) can also be subdivided as follows:

Thus, within a 400-year cycle:

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 (or subcycle) 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 (except February) 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:

Dates with fixed week number

Overview of dates with a fixed week number
MonthDaysWeeks
January 04 11 18 25 W01 – W04
February 01 08 15 22 29 W05 – W09
Later dates differ in any leap year starting on Thursday:
March 01 08 15 22 29 W09 – W13
April 05 12 19 26 W14 – W17
May 03 10 17 24 31 W18 – W22
June 07 14 21 28 W23 – W26
July 05 12 19 26 W27 – W30
August 02 09 16 23 30 W31 – W35
September 06 13 20 27 W36 – W39
October 04 11 18 25 W40 – W43
November 01 08 15 22 29 W44 – W48
December 06 13 20 27 W49 – W52

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. They will never be 12 years apart. The only leap years that can occur 12 years apart are leap years starting on Sunday, Tuesday, Wednesday and Friday.

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:

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

Differences to other calendars

Solar astronomic phenomena, such as equinoxes and solstices, 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 being unable to log in around midnight of 29 December 2014 UTC. [2]

The ISO week calendar relies on the Gregorian calendar, 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 proposals using leap week designs strive to simplify and harmonize this pattern, some by choosing a different leap cycle (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 (i.e. day of the year, doy or DDD, 1–365 or 366) and its day of the week (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
  1. Subtract the weekday number from the ordinal day of the year.
  2. Add 10.
  3. 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

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.

Offset for the day of the month to get ordinal day of the year
MonthJanFebMarAprMayJunJulAugSepOctNovDecAdd
Common year0315990120151181212243273304334dom
Leap year6091121152182213244274305335
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
  1. Multiply the week number by 7.
  2. Then add the weekday number.
  3. From this sum subtract the correction for the year:
    • Get the weekday of 4 January.
    • Add 3.
  4. 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

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 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.

Related Research Articles

A calendar date is a reference to a particular day represented within a calendar system. The calendar date allows the specific day to be identified. The number of days between two dates may be calculated. For example, "25 December 2024" is ten days after "15 December 2024". The date of a particular event depends on the observed time zone. For example, the air attack on Pearl Harbor that began at 7:48 a.m. Hawaiian time on 7 December 1941 took place at 3:18 a.m. Japan Standard Time, 8 December in Japan.

<span class="mw-page-title-main">ISO 8601</span> International standards for dates and times

ISO 8601 is an international standard covering the worldwide exchange and communication of date and time-related data. It is maintained by the International Organization for Standardization (ISO) and was first published in 1988, with updates in 1991, 2000, 2004, and 2019, and an amendment in 2022. The standard provides a well-defined, unambiguous method of representing calendar dates and times in worldwide communications, especially to avoid misinterpreting numeric dates and times when such data is transferred between countries with different conventions for writing numeric dates and times.

The International Fixed Calendar was a proposed reform of the Gregorian calendar designed by Moses B. Cotsworth, first presented in 1902. The International Fixed Calendar divides the year into 13 months of 28 days each. A type of perennial calendar, every date is fixed to the same weekday every year. Though it was never officially adopted at the country level, the entrepreneur George Eastman instituted its use at the Eastman Kodak Company in 1928, where it was used until 1989. While it is sometimes described as the 13-month calendar or the equal-month calendar, various alternative calendar designs share these features.

<span class="mw-page-title-main">Week</span> Time unit equal to seven days

A week is a unit of time equal to seven days. It is the standard time period used for short cycles of days in most parts of the world. The days are often used to indicate common work days and rest days, as well as days of worship. Weeks are often mapped against yearly calendars.

A common year starting on Friday is any non-leap year that begins on Friday, 1 January, and ends on Friday, 31 December. Its dominical letter hence is C. The most recent year of such kind was 2021 and the next one will be 2027 in the Gregorian calendar, or, likewise, 2022 and 2033 in the obsolete Julian calendar, see below for more. This common year is one of the three possible common years in which a century year can end on, and occurs in century years that yield a remainder of 100 when divided by 400. The most recent such year was 1700 and the next one will be 2100.

A common year starting on Monday is any non-leap year that begins on Monday, 1 January, and ends on Monday, 31 December. Its dominical letter hence is G. The most recent year of such kind was 2018 and the next one will be 2029 in the Gregorian calendar, or likewise, 2019 and 2030 in the Julian calendar, see below for more. This common year is one of the three possible common years in which a century year can begin on and occurs in century years that yield a remainder of 300 when divided by 400. The most recent such year was 1900 and the next one will be 2300.

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 depending on which day of the week the year starts. The Dominical letter for the current year 2024 is GF.

A leap year starting on Sunday is any year with 366 days that begins on Sunday, 1 January, and ends on Monday, 31 December. Its dominical letters hence are AG. The most recent year of such kind was 2012 and the next one will be 2040 in the Gregorian calendar or, likewise 2024 and 2052 in the obsolete Julian calendar.

A leap year starting on Monday is any year with 366 days that begins on Monday, 1 January, and ends on Tuesday, 31 December. Its dominical letters hence are GF. The current year, 2024, is a leap year starting on Monday in the Gregorian calendar. The last such year was 1996 and the next such year will be 2052 in the Gregorian calendar or, likewise, 2008 and 2036 in the obsolete Julian calendar.

A common year starting on Saturday is any non-leap year that begins on Saturday, 1 January, and ends on Saturday, 31 December. Its dominical letter hence is B. The most recent year of such kind was 2022 and the next one will be 2033 in the Gregorian calendar or, likewise, 2023 and 2034 in the obsolete Julian calendar. See below for more.

A common year starting on Thursday is any non-leap year that begins on Thursday, 1 January, and ends on Thursday, 31 December. Its dominical letter hence is D. The most recent year of such kind was 2015 and the next one will be 2026 in the Gregorian calendar or, likewise, 2021 and 2027 in the obsolete Julian calendar, see below for more.

A leap year starting on Saturday is any year with 366 days that begins on Saturday, 1 January, and ends on Sunday, 31 December. Its dominical letters hence are BA. The most recent year of such kind was 2000 and the next one will be 2028 in the Gregorian calendar or, likewise 2012 and 2040 in the obsolescent Julian calendar. In the Gregorian calendar, years divisible by 400 are always leap years starting on Saturday. The most recent such occurrence was 2000 and the next one will be 2400, see below for more.

A leap year starting on Friday is any year with 366 days that begins on Friday 1 January and ends on Saturday 31 December. Its dominical letters hence are CB. The most recent year of such kind was 2016 and the next one will be 2044 in the Gregorian calendar or, likewise, 2000 and 2028 in the obsolete Julian calendar.

A leap year starting on Thursday is any year with 366 days that begins on Thursday 1 January, and ends on Friday 31 December. Its dominical letters hence are DC. The most recent year of such kind was 2004 and the next one will be 2032 in the Gregorian calendar or, likewise, 2016 and 2044 in the obsolete Julian calendar.

A leap year starting on Wednesday is any year with 366 days that begins on Wednesday 1 January and ends on Thursday 31 December. Its dominical letters hence are ED. The most recent year of such kind was 2020 and the next one will be 2048 in the Gregorian calendar, or likewise, 2004 and 2032 in the obsolete Julian calendar, see below for more.

The determination of the day of the week for any date may be performed with a variety of algorithms. In addition, perpetual calendars require no calculation by the user, and are essentially lookup tables. A typical application is to calculate the day of the week on which someone was born or a specific event occurred.

<span class="mw-page-title-main">Doomsday rule</span> Way of calculating the day of the week of a given date

The Doomsday rule, Doomsday algorithm or Doomsday method is an algorithm of determination of the day of the week for a given date. It provides a perpetual calendar because the Gregorian calendar moves in cycles of 400 years. The algorithm for mental calculation was devised by John Conway in 1973, drawing inspiration from Lewis Carroll's perpetual calendar algorithm. It takes advantage of each year having a certain day of the week upon which certain easy-to-remember dates, called the doomsdays, fall; for example, the last day of February, April 4 (4/4), June 6 (6/6), August 8 (8/8), October 10 (10/10), and December 12 (12/12) all occur on the same day of the week in any year.

<span class="mw-page-title-main">Ordinal date</span> Date written as number of days since first day of year

An ordinal date is a calendar date typically consisting of a year and an ordinal number, ranging between 1 and 366, representing the multiples of a day, called day of the year or ordinal day number. The two parts of the date can be formatted as "YYYY-DDD" to comply with the ISO 8601 ordinal date format. The year may sometimes be omitted, if it is implied by the context; the day may be generalized from integers to include a decimal part representing a fraction of a day.

The Hanke–Henry Permanent Calendar (HHPC) is a proposal for calendar reform. It is one of many examples of leap week calendars, calendars that maintain synchronization with the solar year by intercalating entire weeks rather than single days. It is a modification of a previous proposal, Common-Civil-Calendar-and-Time (CCC&T). With the Hanke–Henry Permanent Calendar, every calendar date always falls on the same day of the week. A major feature of the calendar system is the abolition of time zones.

References

  1. Gent, Robert H. "The Mathematics of the ISO 8601 Calendar". Archived from the original on 2018-12-24. Retrieved 2011-08-17.
  2. "Twitter kicks Android app users out for five hours due to 2015 date bug". the Guardian. 29 December 2014.