Behind every calendar tool is a simple trick: turn a date into a single day number, calculate with the numbers, and turn the answer back into a date. This guide explains the Julian Day Number used by astronomers, and a quick mental rule for finding the weekday of any date.
- A Julian Day Number gives every day a single number in one continuous count.
- The number of days between two dates then becomes one subtraction.
- The weekday follows from the remainder when the day number is divided by 7.
The problem with dates
Dates are awkward to calculate with because months have different lengths, years have different lengths and the calendar has changed over time. The difference between two dates is easy to see when they are close, but hard when they are years apart. The solution is to give every day a number in one long, continuous count.
The Julian Day Number
Astronomers use the Julian Day Number, or JDN, which is a count of days starting from noon on January 1, 4713 BC in the Julian calendar. It has nothing to do with the Julian calendar of Caesar apart from the name. Every day has a whole number. For example, January 1, 2000 has the JDN 2,451,545, and November 14, 2026 has the JDN 2,461,359. The difference is 9,814 days, which you get just by subtracting. The system was proposed by Joseph Scaliger in 1583 and named after his father, Julius Caesar Scaliger.
Why it is useful
With day numbers, finding the number of days between two dates is a single subtraction, and adding 100 days to a date means adding 100 to the number and converting back. This is how most date tools work internally. Programming languages and databases use similar day counts, as the Unix time guide describes, but with different starting points.
Finding the weekday from the day number
Because the week repeats every 7 days, the weekday follows from the remainder when you divide by 7. If you add 1 to the JDN and divide by 7, a remainder of 0 means Sunday, 1 means Monday, and so on up to 6 for Saturday. For November 14, 2026: 2,461,359 + 1 = 2,461,360. Divided by 7, the remainder is 6, so it is a Saturday, which is correct.
The doomsday rule
The mathematician John Conway invented a method for finding the weekday of a date in your head. Each year has a doomsday: a weekday that is shared by a set of easy-to-remember dates. These dates are 4/4, 6/6, 8/8, 10/10 and 12/12, as well as 5/9, 9/5, 7/11 and 11/7, and the last day of February. In January and February, use January 3 (or January 4 in a leap year) and the last day of February. The doomsday of 2026 is Saturday, so April 4, June 6, August 8 and November 7 are all Saturdays. From November 7, you can count forward a week to find that November 14 is also a Saturday.
Finding the doomsday of a year
For a year in the 2000s, take the last two digits, divide by 12, and note the quotient and the remainder. Divide the remainder by 4 and ignore the remainder of that. Add the three numbers and add 2, the anchor for the 2000s, and take the sum modulo 7. The result is the doomsday, with 0 as Sunday. For 2026: 26 divided by 12 is 2 with a remainder of 2. 2 divided by 4 is 0. The sum is 2 + 2 + 0 = 4, and adding the anchor 2 gives 6. That is Saturday.
Where the formulas come from
The same idea appears in Zeller's congruence, a formula from 1882 that calculates the weekday for any date by treating January and February as months 13 and 14 of the previous year. All these methods use the fact that the calendar repeats in a 400-year cycle with exactly 146,097 days, which is 20,871 whole weeks. The weekday pattern therefore repeats every 400 years.
Try it
The weekday tool on this site gives the result at once. Try the doomsday rule on your birthday and check your answer. With a bit of practice you will be able to name the weekday of any date in a few seconds.