james on Nostr: Integer math (in seconds). I used the solar year × years since 1970 + spring equinox ...
Integer math (in seconds).
I used the solar year × years since 1970 + spring equinox offset + moon phase on Jan 1 1970, less it's modulus by the lunar period, plus a lunar period (this acts like `ceil()` for larger-than-1 intervals). This is the first full moon on or after the spring equinox. Sometimes (*in 2038, especially), this result is too early, so we add a lunar period if this is less than 81 days since the new year. Then, modulus by week and add four days. This is Easter Sunday.
I have some other offsets in there, too, since it's defined by liturgical day, not midnight.
*funny that the built-in PHP function fails on exactly that year.
I used the solar year × years since 1970 + spring equinox offset + moon phase on Jan 1 1970, less it's modulus by the lunar period, plus a lunar period (this acts like `ceil()` for larger-than-1 intervals). This is the first full moon on or after the spring equinox. Sometimes (*in 2038, especially), this result is too early, so we add a lunar period if this is less than 81 days since the new year. Then, modulus by week and add four days. This is Easter Sunday.
I have some other offsets in there, too, since it's defined by liturgical day, not midnight.
*funny that the built-in PHP function fails on exactly that year.