# Date difference calculator

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

- Endpoint: `POST https://setget.net/v1/tools/date-diff` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `date-diff`
- Page: https://setget.net/tools/date-diff

## Inputs

- `start` (required, string): The first date or date and time.
- `end` (required, string): The second date or date and time.

## Example 1

```json
{"input":{"start":"2026-01-01","end":"2026-12-25"}}
```

Result:

```json
{"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"}
```

## Example 2: Across a leap year and a month end

```json
{"input":{"start":"2024-01-31","end":"2026-03-05"}}
```

Result:

```json
{"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"}
```

**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.
