Date difference calculator

Find the time between two dates: total days, weeks, hours, minutes and seconds, plus years, months and days.

Input

The first date or date and time.
The second date or date and time.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/date-diff \
  -H 'Content-Type: application/json' \
  -d '{"input":{"start":"2026-01-01","end":"2026-12-25"}}'
import json, urllib.request

body = {'input': {'start': '2026-01-01', 'end': '2026-12-25'}}
request = urllib.request.Request("https://setget.net/v1/tools/date-diff", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/date-diff", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"start":"2026-01-01","end":"2026-12-25"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "date-diff",
  "input": {
    "start": "2026-01-01",
    "end": "2026-12-25"
  }
}
{
  "input": {
    "start": "2026-01-01",
    "end": "2026-12-25"
  }
}

Endpoint: POST /v1/tools/date-diff. Over MCP: run_tool with slug: "date-diff". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
start string yes The first date or date and time.
end string yes The second date or date and time.

Examples

Input
{
  "start": "2026-01-01",
  "end": "2026-12-25"
}
Result
{
  "start": "2026-01-01",
  "end": "2026-12-25",
  "negative": false,
  "total": {
    "days": 358,
    "weeks": 51.142857,
    "hours": 8592,
    "minutes": 515520,
    "seconds": 30931200
  },
  "calendar": {
    "years": 0,
    "months": 11,
    "days": 24,
    "hours": 0,
    "minutes": 0,
    "seconds": 0
  },
  "text": "11 months and 24 days"
}

Across a leap year and a month end

Input
{
  "start": "2024-01-31",
  "end": "2026-03-05"
}
Result
{
  "start": "2024-01-31",
  "end": "2026-03-05",
  "negative": false,
  "total": {
    "days": 764,
    "weeks": 109.142857,
    "hours": 18336,
    "minutes": 1100160,
    "seconds": 66009600
  },
  "calendar": {
    "years": 2,
    "months": 1,
    "days": 5,
    "hours": 0,
    "minutes": 0,
    "seconds": 0
  },
  "text": "2 years, 1 month and 5 days"
}

Questions

Is the end date included?
No. 1 January to 2 January is 1 day. Add one if you want to count both days.
How are months counted?
Whole calendar months are counted from the start date, then the days left over. When the start day does not exist in a later month, the last day of that month is used.
What about time zones?
Times with an offset are compared exactly. Times without one are treated as UTC, so daylight saving changes are not applied.