4 ms·
Given that you'll rarely need more than this year, and maybe next year, you can preemptively do some math to make it easier. yearcode = (centurycode + [las
by amflare 7y ago
Given that you'll rarely need more than this year, and maybe next year, you can preemptively do some math to make it easier.
yearcode = (centurycode + [last two digits of year] + ([last two digits of year] div 4)) mod 7
So this year (2019) = 1, and next year (2020) = 3 (and also a leap year). These numbers are infinitely easier to keep track of, especially when doing modulo operations in your head.
This link [0] explains the process from this perspective
[0]: https://litemind.com/how-to-become-a-human-calendar/