Add Multiples of 7
Add a multiple of 7 (7–49) to a day (1–31).
Multiples of 7 mod 7 = 0, so the weekday doesn't change,
only the date. e.g. 18 + 21 =
39
7× Table
How many days in N weeks?
e.g. 17 weeks × 7 =
119 days
Large Mod 7 (32–365)
Divide by 7, multiply quotient by 7, subtract.
e.g. 100 ÷ 7 = 14 r 2 →
2
Month Day Offsets
Days elapsed in year before each month starts.
e.g. Oct →
273 days have passed before Oct 1.
Days in Month
30 days: Apr, Jun, Sep, Nov. Feb = 28 (29 leap).
All others = 31.
Day of Year
Month offset + day number (+ 1 if leap and after Feb).
e.g. Mar 5 = 59 + 5 =
64
Nth Weekday
Find 1st occurrence, add 7×(n−1).
e.g. 3rd Mon: 1st Mon = 3rd → 3+14 =
17
Cross-Month Shift
Add shift, roll over month boundaries.
e.g. May 27 + 13 →
Jun 9
Deadline Weekday
Calculate due date then apply full date formula.
Day Count
Days left in start month + full months + days in end month.
Relative Weekday
next: (target − today + 7) mod 7, use 7 if 0.
last: (today − target + 7) mod 7, use 7 if 0.