Guides/Add days to a date
How to add days to a date
“What date is 30 days from today?” shows up in return windows, trial periods, project buffers, and travel plans. Calendar addition must respect month lengths and leap years — you cannot always add 30 and keep the same day-of-month.
The reliable method
Represent the start date as a fixed midnight (for example UTC for that Y-M-D), add N × 86,400,000 milliseconds (N whole days), then read back the calendar date. Negative N subtracts days. That avoids most timezone off-by-ones.
Worked examples
- +30 days: 2026-10-31 + 30 → 2026-11-30.
- +14 days (two weeks): 2026-01-01 + 14 → 2026-01-15.
- Across year end: 2026-12-20 + 15 → 2027-01-04.
- Leap year: 2024-02-20 + 10 → 2024-03-01(Feb 29 exists in 2024).
- Subtract: 2026-03-15 + (−7) → 2026-03-08.
“30 days” vs “one month”
Adding 30 calendar days is not the same as “same date next month” (Jan 31 + 1 month is often Feb 28/29). Contracts and apps should say which rule they use. OurDate Difference CalculatorAdd N days mode uses whole calendar days.
Common mistakes
- Counting inclusively when the policy is exclusive (or the reverse).
- Ignoring Feb 29 when a span crosses late February in a leap year.
- Using local midnight near daylight-saving changes without a fixed calendar reference.
When to use which tool
- Date Difference Calculator — “Add N days” tab.
- Days between dates — compare two dates.
- Days until / business days — countdowns.
Try the calculator
Open theDate Difference Calculator, choose Add N days, enter a start date and N. Private, client-side only.
Related:Days until a date·Checklist Generator