Date Calculator

Find the number of days between two dates, or add and subtract days, weeks, months or years from a date.

Result

Days between
365days
Export:

Two ways to use this calculator

In "Difference" mode you supply a start and an end date and the tool returns the whole number of days between them. It does this by converting each date to a millisecond timestamp, subtracting, and dividing by the number of milliseconds in a day, then rounding to the nearest whole day so daylight-saving offsets never push the count off by one.

In "Add / subtract" mode you start from a single date and shift it by an amount and a unit. Days and weeks are exact multiples; months and years use calendar arithmetic, which is why the result lands on the matching day of a later month or year rather than a fixed number of days away.

How month and year shifts behave

Adding months and years follows the calendar, not a fixed day count, and that occasionally produces a surprising result at month boundaries. If the target month is shorter than the start month, the date can roll forward into the following month — adding one month to 31 January, for example, overflows February and lands in early March.

This is standard date arithmetic and is usually what you want for anniversaries, billing cycles and due dates. If you need an exact number of days instead, switch the unit to days or weeks.

Practical tips

A few pointers for accurate results:

  • For inclusive ranges (counting both the first and last day), add one to the difference, or use the dedicated day counter tool.
  • To count down to a future event, put today as the start date and the event as the end date.
  • Subtracting a span is the same as adding a negative one; use the operation dropdown rather than entering a negative amount.
  • All calculations are at whole-day resolution and ignore the time of day.

Formula

difference: (endDate − startDate) / 86400000;  add: startDate ± amount·unit

Frequently asked questions

What happens adding a month to January 31?
Calendar month arithmetic is used, so the result rolls into the next valid date the same way JavaScript date math does (e.g. it may land in early March).