Calendrical Conversions

CALENDAR_RD is a C++ program which returns information about a given date, by Edward Reingold, Nachum Dershowitz.

The program is interactive. The user enters y, m and d, which represent the year, (numeric) month, and day of a given date. Note that y must be positive. Also note that all dates are implicitly using the Gregorian calendar, extended backwards indefinitely.

Given date = (y,m,d), the program returns

The program halts when a nonpositive value of y is entered.


This code is in the public domain, but any use of it should publicly acknowledge its source.


CALENDAR_RD is available in a C++ version.

Related Data and Programs:

ANALEMMA, a C++ program which evaluates the equation of time, a formula for the difference between the uniform 24 hour day and the actual position of the sun, by Brian Tung.

CALENDAR_NYT, a FORTRAN90 library which shows the correspondence between dates and the New York Times volume and issue number;

CALPAK, a C++ library which converts between dates as computed on various calendars.

DATES, a dataset directory which contains lists of dates in various calendar systems.

DOOMSDAY, a C++ library which is given the year, month and day of a date, and uses John Conway's doomsday algorithm to determine the corresponding day of the week.

WEEKDAY, a C++ library which determines the day of the week for a given day.


Edward Reingold, Nachum Dershowitz.


  1. Edward Reingold, Nachum Dershowitz,
    Calendrical Calculations: The Millennium Edition,
    Cambridge University Press, 2001,
    ISBN: 0-521-77752-6,
    LC: CE12.R45.
  2. Edward Reingold, Nachum Dershowitz,
    Calendrical Calculations I,
    Software - Practice and Experience,
    Volume 20, Number 9, September 1990, pages 899-928.
  3. Edward Reingold, Nachum Dershowitz, Stewart Clamen,
    Calendrical Calculations, II: Three Historical Calendars,
    Software - Practice and Experience,
    Volume 23, Number 4, pages 383-404, April 1993.

Source Code:

Examples and Tests:

You can go up one level to the C++ source codes.

Last revised on 07 December 2008.