What this calculator does
A date duration calculator answers how long a stretch of time is, expressed on its own in each common unit rather than as a mixed breakdown. Enter a start and end date and the total span comes back as a single figure in years, in months, in weeks and in days, side by side, so whichever unit a form or contract actually asks for is there without conversion.
This is a different shape of answer from a "3 years, 2 months, 14 days" style breakdown: it treats the whole gap as one number in each unit, which is the form needed when comparing a duration against a threshold, such as a warranty period stated in months or a residency requirement stated in years.
The formula
The total number of days between the two dates is worked out first, counted either exclusively (the nights between them) or inclusively (including both the start and end date), depending on the counting option chosen. That day total is then divided by 365.25 for years, by 30.4368 for months, and by 7 for weeks, using the average calendar length of each unit.
| Term | Meaning |
|---|---|
| Exclusive count | The number of full days between the two dates, not counting the start date itself. |
| Inclusive count | The same span with one extra day added, so both the start date and end date are counted. |
| Average month and year length | Because calendar months and years vary in length, a duration in months or years is only exact as an average; 30.4368 days is the average month length and 365.25 days is the average year length, accounting for leap years. |
The inputs explained
| Field | What to enter |
|---|---|
| Start date | The earlier of the two dates. If entered after the end date, the two are swapped automatically. |
| End date | The later of the two dates. |
| Counting | Whether to count exclusively (nights between the dates) or inclusively (counting both the start and end date). |
When to use it
Checking a duration against a stated threshold
Visa, residency and warranty rules are often written as "at least 2 years" or "within 6 months", and reading the gap off directly in that unit avoids doing the day-count division by hand.
Comparing the length of two different periods
When two spans need to be compared, such as two employment periods or two project phases, having both expressed in the same unit, typically years or months, makes the comparison direct.
Working out an age or tenure in a single figure
A duration expressed as one decimal number of years, rather than a mixed years-and-months breakdown, is the form often wanted for age, tenure or membership length in a form field.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How does a duration in days convert to years, months and weeks?
The same starting date of 13 August 2026, measured through to a range of later end dates.
| End date | Total duration | In years | In months |
|---|---|---|---|
| 2026-09-13 | 31 days | 0.08 | 1.02 |
| 2026-10-13 | 61 days | 0.17 | 2.00 |
| 2026-11-13 | 92 days | 0.25 | 3.02 |
| 2027-02-13 | 184 days | 0.50 | 6.05 |
| 2027-08-13 | 365 days | 1.00 | 11.99 |
Questions
How is this different from the time between dates calculator?
The time between dates calculator gives a natural-language breakdown such as "1 year, 2 months, 14 days". This calculator instead gives the whole gap re-expressed on its own in each unit, such as 1.20 years or 14.29 months, which suits a form that asks for a single duration figure.
Why do the years and months figures use decimals?
Because a duration measured in years or months rarely lands on a whole number when converted from a day count, the decimal keeps the figure precise rather than rounding it to a mixed breakdown.
What is the difference between exclusive and inclusive counting?
Exclusive counting gives the number of nights between the two dates. Inclusive counting adds one extra day so that both the start date and the end date are themselves counted, which matches how some contracts and bookings define a duration.
Does it matter which date I enter first?
No. If the start date entered is later than the end date, the two are swapped automatically before the duration is worked out, and the result notes that the swap happened.
For a natural-language years, months and days breakdown instead, see the time between dates calculator. For a plain day count between two dates, use the days calculator.