What is the Days Between Dates Calculator?
This tool counts the exact number of full days between any two calendar dates. Whether you are tracking a project deadline, counting down to an event, working out an age in days, or measuring an interest period, it gives you a clean whole-day answer plus the equivalent in weeks. It works for any pair of dates, past or future, and is not tied to any single country or calendar convention.
How to use it
Enter the start date (year, month, day) and the end date in the same format, then submit. The calculator returns the total number of days between the two dates, the signed difference (positive when the end date is later, negative when it is earlier), and the number of weeks.
The formula explained
Each date is converted to a timestamp measured in milliseconds. Subtracting the start timestamp from the end timestamp gives the elapsed time in milliseconds. Because one day contains \(24 \times 60 \times 60 \times 1000 = 86{,}400{,}000\) milliseconds, dividing by that constant converts the gap into days:
$$\text{days} = \frac{\text{date}_2 - \text{date}_1}{86{,}400{,}000}$$The weeks figure is simply the absolute days divided by 7.
Worked example
From 1 January 2024 to 31 December 2024: 2024 is a leap year, so it has 366 days. Counting from Jan 1 to Dec 31 spans 365 days. The calculator returns 365 total days, a signed difference of 365, and about \(52.14\) weeks.
Common Day Counts in Weeks, Months and Years
Use this table to translate a day count into weeks, months or years. Only the week conversion is exact: 1 week = 7 days. Months range from 28 to 31 days, and years are 365 or 366 days, so month and year equivalents are approximate.
| Days | Weeks (days ÷ 7) | Approximate equivalent |
|---|---|---|
| 7 | 1.00 | 1 week (exact) |
| 14 | 2.00 | 2 weeks (exact) |
| 30 | 4.29 | About 1 month |
| 31 | 4.43 | About 1 month |
| 90 | 12.86 | About 3 months |
| 180 | 25.71 | About 6 months |
| 365 | 52.14 | 1 common (non-leap) year |
| 366 | 52.29 | 1 leap year |
| 730 | 104.29 | About 2 years |
Because calendar months differ in length, 30 days from 1 January ends on a different date than 30 days from 1 February. For exact results, enter both dates rather than relying on these approximations.
Example Date Ranges Compared
The table shows the end date minus the start date (exclusive counting). The signed difference is negative when the end date is earlier than the start date. Weeks are days ÷ 7, rounded to two decimals.
| Start date | End date | Total days | Signed difference | Weeks |
|---|---|---|---|---|
| 1 Jan 2023 | 1 Jan 2024 | 365 | +365 | 52.14 |
| 1 Jan 2024 | 1 Jan 2025 | 366 (leap year) | +366 | 52.29 |
| 28 Feb 2024 | 1 Mar 2024 | 2 | +2 | 0.29 |
| 1 Mar 2023 | 1 Mar 2024 | 366 (spans 29 Feb 2024) | +366 | 52.29 |
| 31 Dec 2024 | 1 Jan 2024 | 365 | -365 | 52.14 |
Notes: 28 Feb to 1 Mar 2024 is only 2 days because 29 Feb 2024 exists. The same span in 2023 would be 1 day. In the last row the end date comes before the start date, so the signed difference is negative while the total (absolute) number of days is 365.
Key Terms: Leap Year, Signed Difference and Inclusive Counting
- Leap year
- In the Gregorian calendar, a year is a leap year if it is divisible by 4, except century years, which must also be divisible by 400. So 1900 was not a leap year, but 2000 was, and 2024 is. A leap year has 366 days, with an extra day on 29 February.
- Signed difference
- The end date minus the start date, keeping the sign. It is positive when the end date is later and negative when the end date is earlier. The total (absolute) days is the same number without the sign.
- Exclusive vs inclusive counting
- Exclusive counting, the standard date difference, counts the days elapsed between the dates, so 1 Jan to 2 Jan is 1 day. Inclusive counting counts both the start and end dates, so you add 1: 1 Jan to 2 Jan inclusive is 2 days. Contracts, leave requests and event schedules sometimes need the inclusive version.
- Timestamp / millisecond
- Many computer systems store a moment as the number of milliseconds since a reference point (often 1 January 1970 UTC). One day is 86,400,000 milliseconds when every day is exactly 24 hours.
- Calendar day vs 24-hour period
- A calendar day is a date on the calendar; a 24-hour period is a fixed length of time. They differ when daylight saving time changes, because some local days last 23 or 25 hours. Subtracting local timestamps can then give a result that is off by an hour, which may round to the wrong day count. Normalizing both dates to UTC, or counting whole calendar days directly, avoids this problem.
FAQ
Does it include the end date? No. It counts the gap between the two dates, so Jan 1 to Jan 2 is 1 day.
Can the result be negative? The "signed difference" row is negative if your end date is before your start date. The headline "total days" is always shown as a positive value.
Are leap years handled? Yes. The calculation uses calendar timestamps, so February 29 and leap years are counted automatically.