Methodology

How every figure on this site is computed

The calculations run in your browser, in scripts you can read. This page sets out the rules for date arithmetic, US federal holidays, Hebrew anniversaries, moon phases and moon signs, and how the tests check them.

Whole days, in UTC

A date is a year, a month and a day, with no time of day attached. Date arithmetic converts each date to midnight UTC, works in whole days and converts back. This matters twice a year: arithmetic in local time across a daylight-saving change gains or loses an hour, and an hour is enough to move an answer onto the wrong date. In this arithmetic, local time is used only for the word "today", because that depends on where the reader is.

The eleven federal holidays

The holidays come from 5 U.S.C. 6103(a), and each one is computed from its rule for the year: the fixed dates (1 January, 19 June, 4 July, 11 November, 25 December) and the floating ones (the third Monday in January and February, the last Monday in May, the first Monday in September, the second Monday in October, the fourth Thursday in November).

Two holidays are newer than the rest. Juneteenth was added by Pub. L. 117-17 in June 2021, so the years 1986 to 2020 have ten holidays, and a business-day count across 19 June 2019 does not skip a day the country worked. The Birthday of Martin Luther King, Jr. was first observed in 1986, so 1978 to 1985 have nine. The list before 1978 was different, and for those years the site removes no holidays.

The observed-date rule

Under 5 U.S.C. 6103(b) a holiday falling on a Saturday is observed the Friday before, and one falling on a Sunday the Monday after. The observed date is the day offices are shut, so that is the day a working-day count removes.

The rule can move a holiday into the previous year. When 1 January falls on a Saturday, the day off is 31 December of the previous year, and the site removes that day from a working-day count. A calculation that looked only at one year's own holidays would count that 31 December as a working day.

How the rules are checked

On each build, the test suite checks these rules against known answers: the first year of each newer holiday, the holiday count on each side of 1986 and 2021, no holidays removed before 1978, Independence Day 2026 (a Saturday) observed on Friday 3 July, and New Year's Day 2028 (also a Saturday) observed on Friday 31 December 2027. A sample count on the business-days page must also reconcile: calendar days minus weekend days minus holidays equals the business-day answer, and the table lists exactly the days removed.

The same test suite also compares the holiday code with a second implementation of the statute, written separately. For every year from 1978 to 9999, the two must agree on which holidays the year has and the date of each, on each observed date, on every date a business-day count skips as a holiday, and on the number of business days in the year. For every year before 1978, the site's code must list no holidays. The second implementation finds each Monday and Thursday by checking the days of the month one at a time, while the site's code uses a formula.

Hebrew birthdays, yahrzeit and bar or bat mitzvah

The Hebrew calendar is exact integer arithmetic: the molad of Tishrei and the four postponement rules fix every year, and Cheshvan and Kislev run 29 or 30 days to absorb them. A Hebrew day begins at sunset; the Hebrew birthday calculator asks whether a birth or death was after sunset, moves an after-sunset event to the next Hebrew day, and never estimates a sunset time.

A birthday or anniversary that has no matching day in a year (a 30th of Cheshvan or Kislev in a short year), or that falls in the single Adar of a common year when the target year has two, is shown under both customs in use, labelled. A yahrzeit and a bar mitzvah (at 13) or bat mitzvah (at 12) follow the rules set out in Reingold and Dershowitz’s Calendrical Calculations, which Hebcal also uses. Yahrzeit: a death in Adar II is kept in Adar II in a leap year and in Adar otherwise; a death in the single Adar of a common year is kept in Adar I in a leap year (some also keep Adar II); a death on 30 Adar I is kept on 30 Shevat in a year with one Adar; a death on 30 Cheshvan or 30 Kislev is kept on the 30th if the first anniversary year had one, moving to the 1st of the next month in short years, and otherwise on the last day of that month every year. Bar and bat mitzvah: a birth in the year’s last Adar stays in the last Adar, and a missing 30th moves to the next day.

Each of these conventions is tested on hand-written cases (Adar I and Adar II in leap and common years, 30 Cheshvan, 30 Kislev, after sunset), spot-checked against Hebcal when written, and every case is also checked against a second implementation that takes its calendar from the ICU library built into the browser and JavaScript runtimes rather than from this site’s code; the two must also agree on every day of thirty Hebrew years carried forward to five later years each.

How the moon phases are computed

The usual way to find a moon phase is to count days from a known new moon and divide by 29.530588, the mean synodic month. Real lunations run from roughly 29.27 to 29.83 days, because the Moon's orbit is an ellipse and the Moon moves faster near perigee than near apogee. Within a lunation the error builds up to as much as fourteen hours, enough to name the wrong calendar day for a full moon several times a year.

This site computes the positions themselves, using the series in Jean Meeus's Astronomical Algorithms: chapter 47 for the Moon, 25 for the Sun, 48 for the illuminated fraction, and 49 for the instants of new, first quarter, full and last quarter. Those instants come out in Dynamical Time, so they are converted to Universal Time using the Espenak & Meeus piecewise fit for delta-T, the accumulated drift of the Earth's rotation: about minus three seconds in 1900 and plus sixty-four in 2000. A day is given one of the four principal phase names only when that instant falls inside it; every other day is named for its crescent or gibbous shape.

The phase instants are checked against an outside source. Two hundred and fifty phase instants published by the United States Naval Observatory (drawn from 1900, 2006, 2026, 2048 and 2100, so that the higher-order terms and the delta-T fit are all exercised far from their reference epoch) are held as a fixture in the test suite, and every one is compared on each build. Agreement is within a minute everywhere the Earth's rotation has actually been measured, and no instant falls on the wrong calendar day in any of those years. A second, independent check runs alongside it: the position series and the phase series share no code, so the elongation between Sun and Moon computed by the first must land on its exact multiple of ninety degrees at every instant found by the second.

Past about 2050 the dates remain right and the clock times become uncertain. Delta-T comes from measurement, and nobody knows how fast the Earth will be turning then. Reputable sources already differ by a minute or two over a full moon in 2100. This site uses the standard long-term projection.

How the moon sign and day-type are computed

The sign comes from the Moon's sidereal ecliptic longitude: its position measured against the stars. Tropical longitude is measured from the equinox, which drifts by about one degree every seventy-two years. Sidereal longitude is tropical longitude minus a quantity called the ayanamsa, a convention that no observation can settle, so a sidereal position has to name the ayanamsa it uses. This site uses Fagan-Bradley: twenty-four degrees, two minutes and thirty-one seconds at 1950.0, carried forward by the standard general-precession series, which puts it a little over twenty-five degrees in the present decade.

The sky is then divided into twelve equal thirty-degree signs, and each sign carries one of the four classical elements in the usual triplicities. Fire gives a fruit day, earth a root day, air a flower day, water a leaf day. Changeover instants are found by bisection, solving for the moment the sidereal longitude crosses a multiple of thirty degrees. Bisection is safe here because the Moon is never retrograde in longitude, so a crossing inside a bracketing interval is unique.

The day-types here depart from the printed calendars in two ways. First, those calendars use the observed constellation boundaries, which are very unequal (Virgo spans over forty degrees of the ecliptic and Scorpius about seven), so their day-types often differ from these by a day. Second, this sequence is computed from the Moon's position and copies no published calendar, because a published calendar is somebody's work.

The tradition holds that these days differ in effect. This site does not make that claim: the trials behind it concern sowing, not tasting; they are contested; and the substantial independent study of the question found effects from other lunar rhythms but none from this one. What is printed here is where the Moon is and what the tradition calls that day.

Checking the positions against an outside source

Lunar and solar positions are also checked on every build against NASA JPL's Horizons ephemeris: 105 lunar positions across 1900, 2026 and 2100, and eighteen solar ones. The moon phase check compares the Moon against the Sun, so any error the two share cancels out of it, and one such error got through. Position was being computed from Universal Time using series that are defined in Terrestrial Time, a difference of about seventy-five seconds, which moved the Moon forty-one arcseconds and the Sun only three. Every phase test stayed green, and the comparison with JPL found it.

What each tool is checked against

Each tool carries a one-line note on how its engine is checked. The checks run on every build of the site. Where the reference is an outside source, the published figures are held in the test suite as fixed data, so a check compares the site’s answers with the source, never with the site’s own earlier output.

What is not here

The business-day count removes weekends and US federal holidays, and nothing else. It counts whole days, and it knows no state or municipal holidays, no other country's holidays and no particular institution's working days. Where a deadline counts differently, untick "Skip US federal holidays" to count plain weekdays.