Calendar Date Incrementer
Add or subtract days, weeks, months, or years from any date. Calculate future and past dates with leap year handling and full history.
About
Manually computing a date offset of 90 days from a given start date invites silent errors: forgotten leap years, month-boundary overflows (January 31 plus one month is not March 3), and off-by-one mistakes that cascade into missed deadlines or contract breaches. This tool performs calendar-aware arithmetic on the Proleptic Gregorian Calendar, correctly handling the leap year rule (y divisible by 4, except centuries not divisible by 400) and month-length clamping. It operates on days, weeks, months, and years as independent units, outputting the resulting date, day of week, ISO week number, and Julian Day Number. Limitation: it assumes the Proleptic Gregorian Calendar for all dates and does not account for historical calendar reforms or timezone transitions.
Formulas
The leap year predicate for year y:
Month-year increment with day clamping: given start date (y, m, d) and increment n months:
ISO 8601 week number calculation uses the Thursday-based rule: the week containing January 4 is always week 1.
Julian Day Number from Gregorian date (y, m, d):
Where y = year, m = month (1 - 12), d = day of month, n = increment value (positive or negative integer).
Reference Data
| Month | Days (Common Year) | Days (Leap Year) | Cumulative Days (Common) | Cumulative Days (Leap) | Quarter |
|---|---|---|---|---|---|
| January | 31 | 31 | 31 | 31 | Q1 |
| February | 28 | 29 | 59 | 60 | Q1 |
| March | 31 | 31 | 90 | 91 | Q1 |
| April | 30 | 30 | 120 | 121 | Q2 |
| May | 31 | 31 | 151 | 152 | Q2 |
| June | 30 | 30 | 181 | 182 | Q2 |
| July | 31 | 31 | 212 | 213 | Q3 |
| August | 31 | 31 | 243 | 244 | Q3 |
| September | 30 | 30 | 273 | 274 | Q3 |
| October | 31 | 31 | 304 | 305 | Q4 |
| November | 30 | 30 | 334 | 335 | Q4 |
| December | 31 | 31 | 365 | 366 | Q4 |