Module:Keppel date/doc: Difference between revisions
More actions
Tesinormed (talk | contribs) No edit summary Tag: 2017 source edit |
Tesinormed (talk | contribs) Undo revision 188387 by Tesinormed (talk) |
||
| Line 9: | Line 9: | ||
d_\oplus &= \text{Earth day of year (fractional)} \\ |
d_\oplus &= \text{Earth day of year (fractional)} \\ |
||
d_{\oplus_\text{max}}(y_\oplus) &= \begin{cases} |
d_{\oplus_\text{max}}(y_\oplus) &= \begin{cases} |
||
| ⚫ | |||
366 & y_\oplus = 0 \pmod{400} \\ |
366 & y_\oplus = 0 \pmod{400} \\ |
||
| ⚫ | |||
365 & \text{otherwise} |
365 & \text{otherwise} |
||
\end{cases} \\ |
\end{cases} \\ |
||
Revision as of 16:54, March 20, 2026
Converts the current (or provided) date to a Keppel date. Used by Template:Keppel date.
Formula
\begin{aligned} y_\oplus &= \text{Earth year} \\ d_\oplus &= \text{Earth day of year (fractional)} \\ d_{\oplus_\text{max}}(y_\oplus) &= \begin{cases} 366 & y_\oplus = 0 \pmod{4} \text{ and } y_\oplus \neq 0 \pmod{100} \text{ and } y_\oplus \neq 0 \pmod{400} \\ 366 & y_\oplus = 0 \pmod{400} \\ 365 & \text{otherwise} \end{cases} \\ d_{\text{K}_\text{offset}}(y_\oplus) &= d_{\oplus_\text{max}}(y_\oplus) - 287 \\ d_{\text{K}_\text{max}}(y_\text{K}) &= \begin{cases} 391 & y_\text{K} = 65 \pmod{239} \text{ and } y_\text{K} = 2 \pmod{4} \\ 390 & y_\text{K} = 65 \pmod{239} \\ 390 & y_\text{K} = 2 \pmod{4} \\ 389 & \text{otherwise} \end{cases} \\ y_\text{K} &= \begin{cases} y_\oplus - 892 & d_\oplus - d_{\text{K}_\text{offset}}(y_\oplus) \geq \frac{d_{\oplus_\text{max}}(y_\oplus)}{d_{\text{K}_\text{max}}(y_\oplus - 892)} \\ y_\oplus - 892 - 1 & d_\oplus - d_{\text{K}_\text{offset}}(y_\oplus) < \frac{d_{\oplus_\text{max}}(y_\oplus)}{d_{\text{K}_\text{max}}(y_\oplus - 892)} \end{cases} \\ d_\text{K} &= (\frac{d_\oplus - d_{\text{K}_\text{offset}}(y_\oplus)}{d_{\oplus_\text{max}}(y_\oplus)} \times d_{\text{K}_\text{max}}(y_\text{K}) - 1) \bmod{d_{\text{K}_\text{max}}(y_\text{K})} + 1 \\ L &= \lfloor \frac{d_\text{K} - 1}{32} \rfloor + 1 \\ d_{\text{K}_\text{L}} &= \lfloor d_\text{K} - 1 \rfloor \bmod{32} + 1 \end{aligned}