(no title)
athom | 1 year ago
March through July follow a simple two-month cycle of 31 days, followed by 30, repeating at May and July. August breaks the cycle with 31 days, but it essentially restarts, and runs a second five months before it breaks again, at January (the 11th month, since we started from March). The third run obviously runs out after February, ending prematurely, but this doesn't really break the cycle, either. You just restart again with March!
This allows you to write some (relatively) simple conversions using just a few divisors, along with some conversions from 1-based to 0-based numbering, and back. 153 days every five months, 61 every two, and of course 31 for a single month. Divide the remainder from each prior division by the next divisor, and the final remainder is your (0-based) day of the month. The month itself (taking 0 = March) is then the sum of each quotient multiplied by the associated count of months.
Reversing the process, I'll leave to the reader.
No comments yet.