Plausible phases

So why does that lunar phase method work anyway?

It’s mostly fairly obvious once you start thinking about it. For instance, suppose you know the age of the moon on a given day. Then its age a day later is, kind of obviously, one day more. Except when you hit new moon and it resets, every 29.53… days, and doing modulo 30 approximately accounts for that. So it makes sense for the formula to be something like (x+D) mod 30, where D is the day number and x doesn’t depend on the day (it’s approximately the age, minus 1, on the first of the month).

Now suppose you know the age of the moon on the first day of a given month. Then its age a month later is…? Well, in a 30 day month it’s about 0.47 days more, that is, 30–29.53; in a 31 day month it’s 1.47 days more. Or in an average month of about 365.25/12 = 30.52 days it’s very close to 1 day more. (Actually, since we’re working within the 2000 to 2018 Metonic cycle, the average year length that counts is 1/19 of five leap years and 14 normal years, which comes out to 365.263 days, not that the difference matters much.) If it weren’t for February it’d make sense for the formula to be something like (y+M+D) mod 30, where M is the month number and y doesn’t depend on the day or month (it’s the age at the start of the year, minus 2).

February’s short, though. How to deal with that? Hang on, we’ll get there.

Now suppose you know the age of the moon on the first day of a given year. Then its age a year later is… well, 365.25 days is 12.36 synodic months, so the age advance is 0.36 x 29.53 = 10.9 days. For a decent approximation, 11 days age advance per year, so a formula something like (z+(Y x 11)+M+D) mod 30, where Y is (last two digits of) the year number and z is a constant (the age on 1 Jan 2000, minus 2), would seem reasonable. If it weren’t for February.

It’s too bad February isn’t the last month of the year, then you wouldn’t have to deal with its shortness. Well, make it the last month of the year! Let’s pretend the year begins on March 1. Now within a month each day is a day greater age than the previous; within a (March-to-February) year each month is a day greater age than the previous; and each year is 11 days greater age than the previous. Looked at like this, we don’t have to worry especially about the age advance from February to March. So we could use a formula like the above, if we said March was month 1, April month 2, … January month 11, February month 12, and if we used the preceding year number in January and February. That is, for months March through December use

(z+(Y x 11)+(M–2)+D) mod 30

(here M is still 3 for March, et cetera) and for January and February use

(z+((Y–1) x 11)+(M+10)+D) mod 30 .

That gets a little complicated, though. But we haven’t defined z yet; we can absorb additive constants into it. That is, redefine z–2 as z so we have for March to December

(z+(Y x 11)+M+D) mod 30

and for January and February

(z+((Y–1) x 11)+M+12+D) mod 30 .

But now notice the latter is equal to

(z+(Y x 11)–11+M+12+D) mod 30


(z+(Y x 11)+M+1+D) mod 30

which means we don’t have to mess around with the year number or with month numbers like 13 and 14; just use the same formula for all months, except add 1 in January and February!

Nearly there. We just need to establish z. The age of the Moon at 00:00 UTC on 1 Jan 2000 was 23.882 days, so z is 20.882 or about 21. Or more conveniently, about 22, so we can replace z+(Y x 11) with ((Y+2)x 11), and that’s the formula. There are enough approximations here that one can justifiably worry about their accumulating to large errors, but in fact they tend to cancel out. (1 day per month is nearly exact, modulo 30 arithmetic gives you age increases that are too small, 11 days per year gives you age increases that are too large for non leap years and too small for leap years, z=22 means you start out the cycle with an age that’s too large. Sticking with z=21 would have made 1 Jan 2000 more accurate but would have led to too large errors later in the cycle.)


Depends on the phase of the moon

[Edited for corrections and updates]

What’s the phase of the moon on [insert date here]? Do it in your head.

This is something I found on the Internet once, don’t know where; I learned it but eventually forgot it. Having put it back together again I’m posting it here for future reference. It’s more or less similar to the method, attributed to John Conway, described at much greater length at The two are not mathematically equivalent, though, giving slightly different results for some dates. See below.

To start with, assume the required date is in the range from 1 Jan 2000 to 31 Dec 2018. Take the last two digits of the year, add 2, and multiply by 11.

(Good thing multiplying by 11 is easy. You just add the two digits to the same two digits shifted one place left: e.g. 17 x 11 = 17 + 170 = 187. Or another way to think of it: the last digit of the result is the same as the last digit of the original number, the first digit of the result is the same as the first digit of the original number, and the middle digit of the result is the sum of the two digits of the original number. Of course if that sum exceeds 9, you have to add 1 to the first digit of the result.)

Now add the number of the month — 1 for January, 2 for February, and so on, 12 for December. If the month is January or February, add another 1.

Now add the day of the month.

Now divide that number by 30 and take the remainder. The result is, approximately, the age of the moon — the number of days since the new moon. 0 or 29 would be new moon, 14 or 15 would be full moon, about 7 would be first quarter, about 21 would be third quarter. It might be off a day or so (again, see below), but close enough for mental calculation, right?

What about dates outside that range? The moon returns to the same phase every 19 years exactly — or almost exactly; actually more like 19 years plus 2 hours. This is called a Metonic cycle. So add or subtract a multiple of 19 years to get into the 2000–2018 range and then proceed as above. Obviously for dates far in the past or future this breaks down, but for dates in the past or future few decades it’s fine.

Example: July 20, 1969. This is outside our 2000–2018 range but if you add 2×19=38 years you have July 20, 2007. So: for year 2007, (7+2)x11 = 99; for month 7 add 99+7=106; for day 20 add 106+20=126. To get the remainder when divided by 30, subtract the multiple of 30: 126-120=6. Age of the moon is 6 days, corresponding to just about first quarter. Of course July 20, 1969 is the date of the Apollo 11 landing. If you do the same for the other moon landing dates you get ages in the range 5 to 9. For reasons having to do with the angle of the Sun, NASA chose to do all the moon landings at about first quarter.

Example: January 1, 2018. (18+2)x11 + (1+1) + 1 = 223; 223-210=13. The moon is (about) 13 days old on New Year’s Day, so is close to full. In fact full moon occurs at about 2:00 UTC on January 2, or evening of January 1 in the United States. We get two full moons in January and March, none in February!

How well does this work? It depends on how you define “how well”. You’re getting an integer estimate of the age of the moon, which you can compare to the actual age of the moon… when? At 00:00 UTC? Noon?

Choosing to compare to the age at 00:00 UTC, here’s a plot of the error in this calculation for the years 2000 to 2018. There are just two dates where it’s more than 1.6 days off and most dates — 6269 out of 6940 —are less than 1 day off.

For years outside this range but within the nearest 4 Metonic cycles each way (i.e. from 1 Jan 1924 to 31 Dec 2094) I find there are only two dates where the error is (slightly) larger than 2 days, and average errors in each cycle are under 0.35 days. Outside that 171 year range it gets worse.

And here’s a comparison to the results of the method from gmmentalgym. The blue line is the same as above and the red line is gmmentalgym; they coincide for the first 10 years so you see only the red there. After that they differ by 1 day.

You can see gmmentalgym is systematically high in the second half of the cycle, so does worse. Note, though, that if we compared to the age at noon UTC, it would shift this whole graph down by half a day and the red line would be better than the blue.

On the other hand, here’s the 1962–1980 cycle (comparing at 00:00):

Here it looks like the gmmentalgym method is a little better, but would be much worse if comparing at noon UTC. On balance, I wouldn’t say either method has the clear upper hand — they’re both decent approximations, easily done in one’s head.