Calendar`
Calendar`

DayOfWeek

As of Version 10.0, calendar functionality is built into the Wolfram Language »

DayOfWeek[{year,month,day}]

gives the day of the week on which the given date {year,month,day} occurred.

DayOfWeek[{year,month,day,hour,minute,second}]

gives the day of the week for the given date.

更多信息和选项

范例

打开所有单元关闭所有单元

基本范例  (6)

The Declaration of Independence was signed on a Thursday:

The Bastille was stormed on a Tuesday:

Canada became an independent nation on a Monday:

Wolfram Research began on a Saturday:

This gives the day of the week at the time the formula was input:

Hours, minutes, and seconds do not affect the day of the week:

Options  (5)

Calendar  (5)

Dates in Catholic countries after October 14, 1582 and before September 14, 1752 require the Gregorian option. Louis XIV was born on a Sunday:

Russian Orthodox dates require the Julian option. Russian Orthodox Christmas 2000 was on a Sunday:

The Islamic calendar begins on a Friday:

This date corresponds to one attribution of the Hegira, July 16, 622, in the Western (Julian) calendar:

By definition, Yom Kippur cannot fall on a Friday or Sunday:

Because the Jewish calendar has a leap month preceding Passover, the Wolfram Language uses a numbering starting with Nisan, the month of Passover, and Tishrei, the first month of the Jewish year, is number 7:

Applications  (2)

By definition, the Western calendar rules follow a 400-year cycle. This cycle also includes days of the week, since:

That is, the 400-year cycle has an integral number of weeks (otherwise, the cycle would have 2800 years).

A century never begins on a Sunday:

No matter how the beginning of a century is defined:

Possible Issues  (1)

The Western calendar was modified from Julian to Gregorian for better accuracy. The change deleted 10 days in October 1582 in Catholic countries and deleted 11 days in September 1752 in Britain and her colonies. By default, the Wolfram Language applies the British (American) version. These calendar changes did not affect the day of the week, so there is an issue for DayOfWeek concerning dates after October 14, 1582 and before September 14, 1752. For British dates, the default gives the correct answer. For dates in Catholic countries, it is necessary to use the Gregorian option for Calendar.

The calendar change did not affect days of the week:

George Washington was born on a Tuesday:

Voltaire was born on a Sunday:

Dates after September 2, 1752 and before September 14, 1752 are not accepted by the Automatic option. Use the Gregorian or Julian option for these dates (valid only for non-British Western countries):

Neat Examples  (1)

This computes the number of times each day of the week occurs as a 13th of the month over the complete 400-year cycle of the Western (Gregorian) calendar:

The 13th of the month falls more often on a Friday than on any other day of the week.