What is Nostr?
james / James Lewis
npub1nf9…xa3x
2024-07-12 00:37:36
in reply to nevent1q…q9cz

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.
Author Public Key
npub1nf9vm6uhs4j7yaysmjn9eqlf7et5t6hvrkdqgpd995vcc9yfjyas0pxa3x