logo To Foot
© J R Stockton, ≥ 2012-11-09

Calendar Weeks.

No-Frame * Framed Index * Frame This
Links within this site :-

Links Elsewhere :-

The Calendar Week

Two weeks make one fortnight.

Normal Seven-Day Weeks

The names of the seven days have varied, being dependent on language, time, etc. But the seven-day week itself has been continuously maintained, without any discontinuity, since early times (Babylon, Israel; India); in other words the cycle of seven named days has, overall, not been disrupted - yet.

Indeed, the cycle extends retrospectively back to Archbishop Ussher's Creation Date in conjunction with Genesis Chap.I.

Views differ, however, as to which day is the first day of the week, and as to which is the Holy Day; Genesis and Ussher support the apparent Jewish choice.

In Russia, Saturday is суббота, pronoinced "soobbota", cf. "sabbath", and Sunday is воскресенье, pronounced "vaskryesyenye", the word for "resurrection". Their names of some of the days of the week match numbering - Tuesday "2nd", Thursday "4th", Friday "5th" - but Wednesday is "middle".

The Civil Week varies in absolute duration as the Civil Day does. In each week, at least 6 days each comprise 86400 seconds; but one day may differ by an hour for Summer Time, and one day may differ by a positive or negative Leap Second (in principle, Sunday March 31st might show both effects in the EU).

The Weekend

Cultures with a strong European heritage - and some others - take Saturday and Sunday to be the weekend. Many Muslim countries take Friday and Saturday; all include Friday. Algeria changed from Thu-Fri to Fri-Sat in mid-August 2009. A weekend may be less than two whole days.

Wikipedia : Workweek.

The Start of the Week

The International Organization for Standardization, in ISO 8601, defines the week as being Monday to Sunday. The British Standards Institution agrees, as do European Standards. The beginning of the Book of Genesis also has the day of rest as being the seventh day.

Many British calendars and diaries use Monday as the start of the week; but some still use Sunday.

Traditionally, at least for the English, the week started on Sunday, the Holy Day. Note also "Mittwoch" for Wednesday in German. Others have different Holy Days, perhaps at the end of their week, but generally occurring on the English days Friday or Saturday, and with their own choice of starting and finishing times. The Christian use of Sunday was established by the Emperor Constantine in AD 321.

A reverend friend has written decisively to the effect that Jews and Christians have always agreed that the seventh day of the week is Saturday, although differing as to which should be the day of celebration.

For the Hebrew Calendar Week, see my The Hebrew Calendar.

Dictionary Definitions

Dates are of printing.

But all define Wednesday as the fourth day of the week.

Church Definition

It seems that the Book of Common Prayer of the Church of England (1960?) and The ASB 1980 use, without defining, the week; but presume it to be Sunday to Saturday.

Discontinuities

There have been exceptions :-

Past Revolutionary Rearrangements

France (1793-1805) and the USSR (1929-1940) instituted other calendar arrangements, which were not popular.

Changes in the Start of the Week

In AD 321, the Emperor Constantine made the 7-day week official, with Sunday as the first day.

Near 1973-01-01, Denmark changed the start of the week from Sunday to Monday, requiring a single 8-day week, Sunday-Sunday.

ISO 8601 makes Monday day 1 and Sunday day 7.

Breaks in Sequence

The known breaks are all associated with the International Date Line "moving across" places (not vice versa). The following list is not complete.

For much more information, see A History of the International Date Line by R.H. van Gent.

The Philippines

Hector Santos (Santos, Hector. "The day no Filipinos were born" Sulat sa Tansô. US, April 3, 1997.) writes that original dating was due to the link, via the Americas, with Spain, and that "The disarray was finally settled when the Archbishop of Manila issued a decree that December 31, 1844 be dropped and that December 30, 1844 be followed by January 1, 1845.". USNO supports 1844/45, as does van Gent. The missing day would have been a Tuesday, CMJD -5069.

Alaska

On 1867-03-30, Alaska was sold (for $7.2M) by the Russian Empire to the USA; later, its dating was changed from Julian to Gregorian, and it was moved to the proper side of the effective Date Line. The Calendar change itself, in c.19, would require the loss of 12 dates; the move alone would duplicate a date. If they were done together, Alaska must have lost 11 dates; it also must have had either one eight-day week or one forty-eight hour day. I believe, with RHvG and others, that 1867-10-18 Gregorian (CMJD 3257, Fri) followed 1867/10/06 Julian (CMJD 3257, Fri), making an 8-day week. Toke Nørby has 1867-10-18 (CMJD 3257, Fri) as the first Gregorian date, after 1867-10-05. My date seems probable (some sites have --16 G); the principles seem certain. At least one Web site has implied that part of Alaska changed in August 1900. Wikipedia "Alaskan Purchase" implies Saturday, not Friday.

Fiji, Samoa, c.19

I have read that many of the Fiji Islands (across 180° long.) changed from American dating to Antipodean in 1879, for uniformity (Howse).

I have read that Samoa changed from Antipodean dating to American, by repeating Monday July 4th, 1892 (RHvG, etc.).

A Pacific Island?

I believe that I have read that, elsewhere in the Pacific, around 1944, the Americans invaded a particular Japanese-held island; they did so in their Own Time, in spite of having had to cross the International Date Line to get there. This island remained chronologically in the Too Far West (or East, depending on how you look at it) for many years, since this was convenient for its trade with the USA. However, comparatively recently (IIRC, written 1999), it corrected its dating by dropping a date - but, for trading reasons, it moved the "weekend off" to Sun-Mon, thereby maintaining both its place in the seven-day work cycle and the comfort of its trading partners. Which island(s)? RSVP. URL?? Risks Digest??

Kwajalein (and/or Eniwetok and Bikini atolls)

To Risks Digest 14/87, PGN appended :

[I wonder what happened in Kwajalein, where there was NO Friday, August 20, 1993. Thursday night at midnight Kwajalein switched sides with respect to the International Date Line, to rejoin its fellow islands, going from 11:59 p.m. Thursday to 12:00 a.m. Saturday in a blink. Are there any RISKS readers out there who have anything to report? PGN]

But other sources say that Saturday 21 August 1993 was omitted.

Also seen in Usenet archives, comp.protocols.time.ntp : and it exceeds Kwajalein's 23-hour change from GMT+11 to GMT-12 in October 1969.

In Wikipaedia discussion : "Kwajalein was requested to change its time zone by the government of the Marshall Islands to conform to the time zones of those islands and did so in 1993. To maintain contact with the continental US, Kwajalein simultaneously changed its work week from Monday thru Friday to Tuesday thru Saturday. They still use Tue-Sat" - JK.

Kiribati

From the start of 1995, the Eastern part of Kiribati changed from American to Asian dating, in order to match the Western part (USNO, RHvG). This has given the International Date Line a most peculiar shape.

For the Millennium

I have read that some Pacific Islands "Crossed the Line" from the New World to the Old World late last century, in order to attempt the First Sunrise of the "Millennium"; these too will have missed a date. But this was not the purpose of the Kiribati change.

Samoa and Tokelau

Samoa and Tokelau changed their winter time from GMT-11 to GMT+13, by omitting 2011-12-30 Fri, in order to match Australia and New Zealand. Therefore, they had a six-day week.

The Numbering of the Days of the Week

ISO 8601 numbers the days from Monday=1 to Sunday=7; the British Standards Institution and European Standards agree.

Naturally, the language C and its followers, and North America & the Middle East, do it all differently.

Normally, the day numbers are considered ordinal, from the first to the seventh, as is the case for the days of the month. But some systems prefer cardinals, with the days being numbered 0 to 6 in sequence; this is commonly used where computing follows C-type tradition rather than using external standards. It can be convenient to consider both 0 and 7 as representing Sunday.

Zeller's Congruence is an efficient way to get day-of-week from date, Julian & Gregorian. From a DayCount, little more than a mod-7 operation can be needed.

Naming the Days of the Week

Schemes of naming the days of the week differ widely. In some languages, part or all of the naming is numeric or part-numeric. In others, the actual spelling of the days follows no system, the names having been chosen for other reasons. Many Western European languages use names which can be traced back to those of the Gods or Planets of Classical times; see Wikipedia, etc.

In English, it is customary to use three-letter abbreviations - Mon Tue Wed Thu Fri Sat Sun - but the first two letters suffice. In German, two-letter abbreviations are used. In some other languages, it appears that four or more letters might be needed.

Re-Naming the Days of the Week

In a well-designed language, the Day-of-Week names would be of equal length and in alphabetical order, starting with Monday (but giving other days an additional earlier name for use in locations where the week starts too soon). They would start with different three-, two-, and one- letter abbreviations.

The month names would be also be of equal length and in alphabetical order, with distinct abbreviations.

Twelve month-names and thirteen day-names fit in the common alphabet.

Calendar Weeks Per Calendar Year

The Calendar Year 2000 started on a Saturday and finished on a Sunday, thereby requiring 54 weeks or part-weeks on a Sun..Sat basis; this happens (in 1901..2099) at 28-year intervals, for any year containing a Tuesday February 29th. All other calendar years require exactly 53 weeks or part-weeks (52 is clearly insufficient for 52×7+1=365 days). The situation occurs equally often for weeks starting on any other day; but is different with the ISO 8601 definition of Week Number.

Calendar Year 2012 contains 54 weeks or part-weeks on a Mon..Sun basis, like all years with a Wednesday February 29th. Its days belong to three different ISO week-numbering years.

There are on average exactly 52.1775 7-day weeks in a Gregorian year, and 52.17857142 (last 6 digits recurring) in a Julian year.

Finding a Day of the Week

To go (if necessary) backwards to a particular day of the week, one should use something like Result = DayCount - (7*J+D-K) mod 7, where K depends on the day of week required and D is current DayOfWeek or DayCount. J is a constant that ensures that the argument of mod 7 is non-negative. In some cases (e.g. to go to a Delphi Sunday) the expression can be simplified before evaluation.

To go forwards, Result = DayCount + (7*J-D+K) mod 7.

To go to the previous or next instance of that day of the week, adjust both K and result by 1.

Next Year of the Same Type

Years can have two lengths, and can start on any of the seven days Monday to Sunday. So there are fourteen different possible types of secular year.


Coding Note : On my P4/3G, WinXP sp3, Firefox 3.6.17, using Type2 is about 20 times faster than using Type1; and the current code (which steps years counting the excess days over 52 weeks until a multiple of 7 is reached at a year of the right length) is about 5 times faster than that with Type2.

Day-of-Week Steps

Day-of-Week Steps for the Same Date
After Intervals of Years
Interval of Years 0 481216202428. . .
  Day-of-Week Step  0-2+3+1-1-3+20. . .
The intervals must contain no "missing Leap Days"
After Intervals of Centuries
Interval of Years100200300     400. . .
  Day-of-Week Step  -2+3+10. . .
 Each century must contain
a "missing Leap Day"
 

A Week Hoax

I have seen a copy of an E-mail, as next indicated, referring to July 2012 :-

"This year, July will have 5 Fridays, 5 Saturdays and 5 Sundays.
  A purported calendar page for "Julio 2012", with Friday Saturday Sunday
  on days 1 2 3, 8 9 10, 15 16 17, 22 23 24, 29 30 31.

This happens only once every 823 years."

N.B. : An earlier version stepping one day at a time, and considering only months with Sunday 31st, took about 1.05s with civil time functions, 0.30s with UTC ones, 0.18s with the one day step then optimised. That, stepping a week at a time, took 0.03s. This does seven times more work, 0.20s. All P4/3G WinXP sp3 FF11.0.

For each of the seven types of common year, and for each of the seven types of leap year, one type has no such month, five types have one such month, and one type has two such months. If January is such a month, there will be another such month in that year. If March, May, August, or December is such a month, there will be no other such in that year. If July or October is such a month, January of that year, and no other, might be such a month.

Absolute Week Numbering

Sometimes a simple Week Count is needed. Select a suitable arbitrary starting week as Week 0, get a Day Number with the first day of that week being Day 0, and the Week Number is the integer part of the quotient of Day Number divided by seven.

Proleptic Gregorian A.D. 0001-01-01 was a Monday, also 1601-01-01, 2001-01-01, etc.; 1900-01-01 was a Monday; and CJD 0 = Julian BC 4713-01-01, was a Monday too.

Alternatively, use a Seconds Count or similar; but it is then necessary to consider possible effects of Summer Time.

See also in Week Number Calculation.

GMT Weeks
Local Weeks

The Numbering of the Weeks of the Year

The International Organization for Standardization provides definitions of the Week and of the Week-of-the-Year Number in ISO 8601; weeks here are ISO Weeks unless otherwise indicated. Additionally, non-standard weeks and numbering are in use, particularly for financial purposes and also generally in the USA (see below).

Naturally, North America & the Middle East do it all differently.

Wikipedia : Seven-day week, Week numbering

For Microsoft's views on Week Numbers, see below.

ISO 8601 Week Numbers

The system was inherited from ISO 2015, which I have not seen.

ISO Definition & Consequences

ISO 8601 defines the Week as always starting with Monday being Day 1 and finishing with Sunday being Day 7. Therefore, the days of a single ISO Week can be in two different Calendar Years; and, because a Calendar Year has one or two more than 52×7 days, an ISO Year has either 52 or 53 Weeks.

The first Week of a Year is Number 01, which is :-

The conditions are mutually equivalent. See Markus Kuhn and R.H. van Gent, via Date and Time Formats, for example.

The last Week of a Year, Number 52 or 53, therefore is :-

Thus the ISO 8601 Week Numbers of a year are 01 to 52 or 53, which does not include zero. Part of Week 01 may be in the previous Calendar Year; part of Week 52 may be in the following Calendar Year; if a year has a Week 53, part of that week must be in the following Calendar Year. On average, six times out of seven, adjacent Dec 31st & Jan 1st are in the same Week.

For 53-Week ISO Years : January 1st and December 31st will usually both be Thursdays; but if the year is Leap then just one of them will be a Thursday.

Week 53 can only start on the 27th and (more often) the 28th of December, and of course the previous week must be Week 52.

February 29th is the last of the nine days of the year which always have the same ISO Week Number - I think.

A date in Week Number form should be written as yyyy-Www-d.

Note : the Week Number of a given date does not depend on whether its year is Leap, except for one day of every seven in March to December.

My week-cal.txt shows ISO Week Numbers for the calendar years 1970-2030.

There are 15 possible Week-numbering-year types. Clearly there are 14 possible Gregorian types corresponding to February having 28 or 29 days and the year starting of 7 possible days of the week. 13 of those have only one possible numbering, but a year starting on Saturday has Jan 1 & 2 in either Week 52 or 53 of the previous year, depending on whether it was a Leap Year. See in The 15 possible ISO calendars (1 MB).

ISO 8601:2004 does not refer to Week 53 as a "leap week". That seems to me to be an undesirable usage, liable to cause a year of 53 weeks to be termed a "leap year" and so to lead to confusion.

First Weeks of Particular Years

ISO 8601 Week 01 of 2001 started on January 1st; and the Gregorian Calendar repeats exactly, apart from Easter, every 400 years. Therefore, the First Week of the First Year of the First Century of the Third, Fifth, Seventh, ... Gregorian Millennia of our Era starts on the First Day of the Year, Century, and Millennium.

Our late and farsighted monarch, King George II, cunningly arranged to drop 11 days from a year which would then end on a Sunday : I think this is why my Pascal code for ISO week number, which inherently allows for the missing days but not for short years as such, appears correct over 1752-1753. But 1582 ended on a Monday, alas.

Weeks Per Year

Long-term, in every 400 years, 71 ISO years have 53 Weeks; they are at intervals of 5 or 6 years, with one 7-year interval (e.g. around 1900).

Moderately simple rules for the number of Weeks of an ISO Year exist; some of them are wrong.

The number of ISO weeks belonging to a year number is equal to the number of Thursdays in the correspondingly-numbered calendar year, and is equal to the week number of December 28th; and a year has 53 weeks if and only if the following New Year's Day is in its Week 53. The 53-week years in 2000-2027 are 2004, 2009, 2015, 2020, 2026; and that pattern repeats every 28 years before 2100.

On the Julian Calendar, and therefore on the Gregorian within 1900-2100, there are 23 years of 52 weeks and 5 years of 53 weeks in every 28 years; on the full Gregorian, 329 of 52 and 71 of 53 in 400.

In a long year, at least one of January 1st and December 31st will be a Thursday; and I have read that the Dominical Letter will be D for some or all of the calendar year.

I have read that : We will always experience a week 53 when December 31st falls on a Thursday, or in the case of a leap year when December 31st falls on either a Thursday or a Friday. (The corresponding requirements for January 1st are when it falls on a Thursday, or in the case of a leap year on a Wednesday or a Thursday.) (Sven Pran, confirmed by Lars Nordentoft). If one considers a pseudo-year, exactly 51 weeks shorter, of 8 or 9 days, the result becomes more evident, since every week within an "ISO week number year" has its Thursday within the corresponding Calendar year.

Function IsWk53 below is greatly modified from, but equivalent to, Fortran subroutine figure in section 6 of Calendar Reform by Prof. Dick Henry of JHU, USA - which is intended for a quite different purpose!

Weeks Per Month

Reference to the Nth week of a given month is common, but usually ambiguous.

ISO 8601:2004 does not define a Week-of-the-Month number.

If weeks are assigned to months as ISO 8601 assigns them to years, each month has either four or five weeks. Five-week months are separated by 1, 2, or 3 four-week months. A February with five weeks must end on Thursday 29th.

From a Perl page :-

The week of the month, from 0..5. The first week of the month is the first week that contains a Thursday. This is based on the ICU definition of week of month, and correlates to the ISO8601 week of year definition. A day in the week before the week with the first Thursday will be week 0.

But note that ISO does not support Week 0.

Function WPM determines the number of Thursdays in the Calendar Month, 4 or 5.

Function RPM determines the number of week rows in the Calendar Month, 5 or 6.

Weekly Scheduling

If annual or monthly events were to be scheduled by week number and day number, rather than by Month and Date, then the schedule would not need to change from year to year. For example, Summer Time could start at the end of Week 12 and finish at the end of Week 43, every year; meetings now held monthly could be scheduled for every fourth week (omitting Week 53).

Possible Alternative Definition

The official definition in ISO 8601 uses the best approach for most purposes.

Alternatively, one could start by defining AD 0000-01-01 to be 0000-W01-1 (no change; note, Monday), and counting days.

From such an origin, one just needs to count Day-of-Week from 1 to 7, carrying into Week Number which is counted from 1 to 52 or 53. At the end of Week 52, one consults a list of 400 entries (indexed by year number modulo 400) to see whether the next week is to be numbered 01 or 53; the rest is then obvious.

The Gregorian secular calendar repeats, including Day-of-Week, every 400 years.

As the intervals between 53-week years are almost always either 5 or 6 years, the 400 entries can be encoded as a list of 70 one-bit entries, plus special handling of the single 7-year interval. If the list begins with the entry for years 400×N+303, which follows the seven-year interval, that interval will not need to be considered explicitly. After the end of the list, one restarts after seven years at the beginning of the next cycle.

The 70-character string contains no multiple zeroes, so is compressible.

It may be possible to implement, based on that but with the counting replaced by the use of expressions derived by some form of symbolic integration, a direct conversion from MJD to yyyy-Www-d.

Non-Standard Week Numbers

See also in Other Possible Calendars.

Different Definitions

There are many other possible definitions of Week 1 of a year (from which the other weeks follow naturally, apart from the question of a possible Week 0). Companies often choose their own standards; it seems, sometimes very different ones.

Ordinary week numbering has Week 1 at about the beginning of the Calendar Year; but Financial Years commonly start at other times of the Calendar Year, and corresponding Week and Month numbering may be used. Some start on a particular date; others on the first occurrence of a particular weekday on or after a particular date; others?

I understand that, in the USA, Week 1 may be that week, Sun..Sat, which contains January 1st! Or even that it starts on January 1st and finishes on the first Saturday of the year, being followed by seven-day weeks and probably another, shorter, one. Others choose the first full week of the Calendar year, which is the one containing the 7th of January. Week Number 1 may be the first week partly, mostly, or fully in the calendar year; or later.

In the USA, the first week of the year (and presumably the last) may be fractional - and numbered from 0 or 1 (Sun Java doc). Or it may be ("absolute") January 1st to 7th, which I hear the US military use.

A UNIX man page offers inter alia : The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01.

It appears that a Week-of-the-Month Number may also be used; I know little of that.

I have JavaScript Non-ISO week code, for various types of numbering.

HM Revenue and Customs Tax Weeks

Similar to Tax Months; the HM Inland Revenue PAYE guide read as follows :-

Income tax weeks (tax weeks)

Tax weeks are periods of seven days which follow on from each other starting on 6 April each year. The first tax week is 6-12 April inclusive, the second tax week 13-19 April inclusive, and so on.

The odd day or days at the end of the last complete tax week in the year (5 April or in leap years 4 and 5 April) are treated as a whole tax week, that is tax week 53.

Info supplied by Bill Lyons.

Note that the leapness in question is that of the calendar year containing the end of the tax year; so the Tax Year starting in 1999 was Leap. My dateprox.pas can calculate these, as does page JavaScript Calendars and Clocks.

I have JavaScript UK Tax Week code.

April 5th/6th often fall on a weekend; accountants must be accustomed to that. Occasionally, those dates coincide with Easter holidays, which could be a problem.

US Internal Revenue Service Weeks

The US IRS evidently clusters weeks into monthly 4/5-week Report Cycles, numbering the weeks as YYYYWW from Jan 1 or near that; details are unknown.

Microsoft Weeks

Microsoft's view may differ; always verify their "localisation" information. I have been informed that Windows 98SE and 2000 have week information which is wrong for the UK (also their UK Win98FE Summer Time was wrong). For a list of the different locale-dependent week settings in Windows 98, NT & 2000, see the Week Number pages by Peter Haas (in German and in English). Pearson have a page Week Numbers in Excel, with links to related procedures.

R.H. van Gent: "Microsoft defines the first week in the year as the week that contains 1 January".

Microsoft Week 1 is generally less than 7 days; and, about once per 28 years, there is a Week 54 consisting of Sunday Dec 31st, 2000 being one such year.

For Microsoft "ISO week numbering" with DatePart, see in International Standard ISO 8601 Week Numbers.

Programme Weeks

It appears, from Barney Wol's site and from E-mail, that the BBC (and others?) have Programme Week Numbers, for weeks running from Saturday to Friday as in the published listings.

I understand that Programme Week 1 is defined as containing the first Tuesday of the year; it will therefore contain January 4th, is the first one mostly in the Calendar Year, and starts on the Saturday nearest to January 1st. Programme Week Numbering has properties analogous to ISO 8601 Week Numbering. A day's schedule starts at 06:00 local time.

Day-Of-Week Frequencies

The Julian Calendar repeats every 28 years, the Gregorian every 400. All Julian calendar dates, and all Gregorian between "missing" Leap Days, have equal day-of-week frequencies; for full Gregorian, see below.

Week Number Calculation; Date Miscellany I & Date Miscellany II;
Zeller's Works; Time Miscellany.
Home Page
Mail: no HTML
© Dr J R Stockton, near London, UK.
All Rights Reserved.
These pages are tested mainly with Firefox and W3's Tidy.
This site, http://www.merlyn.demon.co.uk/, is maintained by me.
Head.