Date Difference Calculator

Find the exact gap between two dates: a calendar breakdown plus totals in weeks, days, hours and weekdays.

Interpret as
Quick:

How to use

  1. Type or paste a Start and an End date: a date on its own (2025-01-15) or with a time (2025-01-15T10:30:00). Or click a Quick range: until the end of this year, since its start, or today plus 30 or 90 days.
  2. Pick Interpret as (UTC or your browser's local time) for whichever inputs have no time zone of their own.
  3. Read the headline sentence for the calendar breakdown, the timeline under it (month or year marks, and a red today marker when today falls inside the range), and the totals in days, weeks, weekdays, hours, minutes and seconds. Click any total to copy it.
  4. Use ⇅ to swap the two dates, Set end to now for "how long ago/until", or Copy result to take the whole answer.

A calendar-aware answer, not just a millisecond count

The gap between two dates has two honest answers that don't agree: "exactly how many seconds/days/weeks apart" (a fixed number, easy to compute) and "how many years, months and days" (a calendar concept, where the same number of days means a different number of months depending which months they fall in). This tool gives both: a plain-English calendar breakdown as the headline, and exact totals in every fixed unit underneath it, rather than picking one and hiding the other.

Example

2025-01-15 to 2025-06-01T14:30:00 is:

4 months, 17 days, 14 hours and 30 minutes

That's also 137 days, 19 weeks, and 98 weekdays (Monday-Friday) in total.

Options explained

Edge cases and common errors

Do the same thing in code

// JavaScript: total days is straightforward; a real calendar (years/months/days)
// breakdown needs month-length-aware logic like this page's own src/lib/date-diff.ts
const ms = new Date('2025-06-01') - new Date('2025-01-15');
const days = Math.floor(ms / 86400000);

# Python: dateutil.relativedelta gives a real calendar breakdown out of the box
from dateutil.relativedelta import relativedelta
from datetime import date
relativedelta(date(2025, 6, 1), date(2025, 1, 15))

Working with a raw Unix timestamp instead of a date string? The Unix Timestamp Converterconverts it to a date first. Paste that result straight into either field here.

Date Difference Calculator FAQ

Why does a month not always mean the same number of days?

Because months genuinely aren't the same length; they run 28 to 31 days depending which one. This tool reports the largest whole years and months that fit between your two dates, then whatever's left over as days (and, if relevant, hours/minutes/seconds), the same convention most date calculators use, rather than a fixed 30-day average that would make "1 month" mean something different depending on which months it actually spans.

What happens right at a month-length edge, like 31 January to 1 March?

That exact case is worth naming because a naive day-by-day subtraction gets it wrong: from `2024-01-31` to `2024-03-01` this tool reports 1 month and 1 day. Advancing 31 January by one month lands on 29 February (2024 is a leap year), one day short of 1 March, rather than incorrectly borrowing January's 31 days against February, which only has 28 or 29.

What if the end date is earlier than the start date?

It still works. The tool shows the same breakdown for the gap between them and adds a note that the order was reversed, rather than erroring. Swapping the two dates with the ⇅ button gives the identical answer without the note.

Why do I get a different answer depending on Interpret as?

Only when a date has no time zone written into it: the same reasoning the Unix Timestamp Converter uses for the same option. `2025-01-01T00:00:00` to `2025-01-01T10:00:00` is exactly 10 hours either way here, since both inputs share the same missing zone and cancel out. But comparing a zone-less date against one with an explicit offset (or against "now", which is always a fixed instant) can genuinely shift by hours depending which zone the zone-less one is read in.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta. Implements ECMA-262: the Date object.