What the date calculator does
The date calculator finds the exact interval between two calendar dates and expresses it as days, weeks, months and years. It handles leap years, months of different lengths and dates in either order automatically, so you can use it for anything from counting down to an event, checking how many days a contract or warranty has left, working out an invoice due date, or measuring how long you have been at a job.
How the difference is calculated
Days are the only unambiguous unit. The calculator converts both dates to a day count from a fixed reference (the same approach every computer uses internally), subtracts, and reports the absolute difference. Weeks are simply days ÷ 7.
Days = |serial(date₂) − serial(date₁)|
Weeks = Days ÷ 7Months and years are harder, because months are not the same length. The calculator counts whole calendar months by stepping the earlier date forward one month at a time until it would pass the later date, then reports the remainder in days. That is how ages, tenancies and most legal periods are counted: 15 January to 15 March is exactly two months, even though it is 59 days in a common year and 60 in a leap year.
Worked examples
| From | To | Days | Weeks | Months |
|---|---|---|---|---|
| 1 Jan 2025 | 31 Dec 2025 | 364 | 52.0 | 11 months 30 days |
| 1 Jan 2024 | 1 Jan 2025 | 366 (leap year) | 52.3 | 12 months |
| 15 Feb 2025 | 15 May 2025 | 89 | 12.7 | 3 months |
| 28 Feb 2025 | 28 Feb 2026 | 365 | 52.1 | 12 months |
| 31 Jan 2025 | 28 Feb 2025 | 28 | 4.0 | 0 months 28 days |
Notice the last row: stepping 31 January forward one month lands on a date that does not exist (31 February), so it is not yet a full month by 28 February. Different software resolves this edge case differently; the calculator follows the convention that a month is complete only when the same day-of-month is reached.
Inclusive vs exclusive counting
“How many days from Monday to Friday?” has two defensible answers: 4 (the difference) or 5 (counting both ends). The calculator reports the difference — the number of midnights crossed — which is what “days until” and “days since” normally mean. If you need an inclusive count (nights of a hotel stay are exclusive, days of a rental car are usually inclusive, days of a sick-leave certificate are almost always inclusive), add one to the result.
Leap years and other calendar quirks
- Leap-year rule: a year is a leap year if divisible by 4, except century years, which must be divisible by 400. So 2024 and 2000 are leap years; 1900 and 2100 are not.
- 29 February birthdays: in non-leap years most jurisdictions treat 1 March as the legal anniversary, some use 28 February. The calculator's month-stepping uses the last valid day of the month.
- Time zones: the calculator compares calendar dates, not instants, so a date entered as 5 March is 5 March regardless of where you are. For elapsed hours across zones, use a time calculator.
- Historical dates: the tool uses the Gregorian calendar throughout. Dates before a country adopted it (1582 in Catholic Europe, 1752 in Britain and its colonies, 1918 in Russia) were recorded in the Julian calendar and differ by 10–13 days.
Common uses
- Payment terms: an invoice dated 12 March on net-30 terms is due 11 April; the calculator confirms the interval and lets you check for weekends if you count business days separately.
- Pregnancy and medical: weeks since a given date is the standard way pregnancy and post-operative recovery are tracked.
- Employment: length of service for notice periods, probation and holiday accrual is counted in whole months from the start date.
- Visa and travel: many visa-free schemes allow “90 days in any 180-day period”; counting exact days matters because overstaying by one day can carry penalties.
- Project planning: converting a deadline into remaining weeks makes it easier to allocate work.