2 ms·
> The easiest way to code it is to just precompute the year % 400 table and report the results. If you are interested, Chrono [1] internally uses the exact tab
by lifthrasiir 7y ago
> The easiest way to code it is to just precompute the year % 400 table and report the results.
If you are interested, Chrono [1] internally uses the exact table. Constants there refer to dominical letters [2].
[1] https://github.com/chronotope/chrono/blob/a4488007272569f7529dc1bfe61d417d22391104/src/naive/internals.rs#L40-L69 https://github.com/chronotope/chrono/blob/a4488007272569f752...
[2] https://en.wikipedia.org/wiki/Dominical_letter https://en.wikipedia.org/wiki/Dominical_letter