Dates formula
Years Between Two Dates
Years between two dates are counted by anniversaries, the way an age is: a year is complete when the same day and month come round again. The result is a whole number plus leftover months and days, and it does not depend on how many leap days fell in between. A decimal figure such as 8.8 years is a different, approximate measure.
Formula
whole years = end year − start year, minus 1 if the end date falls earlier in the calendar year than the day and month of the start date; the remainder is then counted in whole months and days (the start day is not counted)
- start date
- the earlier date, such as a date of birth or a first day of employment
- end date
- the later date, at which the age or length of service is wanted
- anniversary
- the same day and month as the start date in a later year
- whole years
- the number of anniversaries reached on or before the end date
- remainder
- the months and days from the last anniversary reached to the end date
- decimal years
- total days ÷ 365.25, an approximation that spreads leap days evenly
Date Difference Calculator Retirement Date Calculator
What it means
A year between two dates is not 365 days. It is the step from a date to the same date twelve months later, and that step is 365 or 366 days long depending on whether it crosses 29 February. Counting by anniversaries hides the difference, which is what people expect: someone born on 10 May is one year older every 10 May, and nobody takes off a day for leap years.
To count, subtract the year numbers, then ask whether the anniversary has arrived in the final year. If the end date comes earlier in the calendar than the day and month of the start date, the last year is not complete, so take one off. What is left after the whole years is counted in months and days by the same idea, which the page on months between two dates covers. Whole years on their own always round down: 8 years and 11 months is 8.
The awkward start date is 29 February, which has a true anniversary only in leap years. In other years the anniversary has to be placed on 28 February or on 1 March, and both conventions are in use. The calculators on this site show the split. The Date Difference Calculator does not treat the year as complete until 1 March, while the Retirement Date Calculator, which adds years to a date of birth, lands on 28 February. Where a legal age or an entitlement is at stake, the rule comes from the relevant law or scheme, and it varies between countries.
Decimal years answer a different question: how much time, as a quantity, lies between the dates. Divide the total days by 365.25, the average length of a year across a four-year cycle. The result is good for comparisons, averages and growth rates, and it is slightly off for any particular period, because real periods contain a whole number of leap days. Do not turn a decimal back into a date; use anniversaries for that.
Other forms
- Age or length of service in completed years
- completed years = whole years, with the leftover months and days dropped and never rounded up
- Decimal years
- decimal years = (end date − start date) ÷ 365.25
- Year in which a given age is reached
- year = year of birth + age
- Date a number of years after a start date
- end date = the same day and month that many years later (for 29 February in a year without one, 28 February or 1 March, depending on the rule in use)
Worked example
You started with your employer on Monday 4 September 2017. A staff benefit depends on completed years of service on 30 June 2026.
- Subtract the year numbers: 2026 − 2017 = 9
- Check the anniversary: 30 June comes before 4 September, so the ninth year is not complete, and 9 − 1 = 8 whole years, reached on 4 September 2025
- Whole months after that: 4 September 2025 to 4 June 2026 is 9 months
- Leftover days: 4 June to 30 June is 26 days
- Total days: the 8 years contain 8 × 365 + 2 leap days = 2,922 days, and 4 September 2025 to 30 June 2026 is 299 days, so 2,922 + 299 = 3,221
- Decimal years: 3,221 ÷ 365.25 = 8.82
Result: On 30 June 2026 you have 8 years, 9 months and 26 days of service: 8 completed years, or about 8.82 years as a decimal. The ninth year is completed on 4 September 2026.
Where it is used
An advert asks for "five years of experience in project delivery". Your first relevant role began on 14 January 2022, you have worked in the field without a break, and applications close on 30 November 2026. Subtracting the year numbers gives 4, and 30 November is past the January anniversary, so nothing comes off; the remainder is 10 months and 16 days. That makes 4 completed years, not 5. The accurate wording is "almost five years", and it is often still worth applying, because many employers treat such figures as a guide. Writing "five years" would be untrue on the closing date, and your own dates would show it.
Common mistakes
- Subtracting the year numbers only, which counts a year that is not yet complete whenever the end date falls before the anniversary.
- Dividing total days by 365 and rounding, which can push a period that is one day short of five years up to exactly 5.
- Rounding 8 years and 9 months up to 9 when a rule, a form or an advert asks for completed years.
- Using a decimal such as 8.82 years to work out a date, when only anniversary counting gives the right day.
- Assuming everyone handles a 29 February start in the same way, when the anniversary in other years may be placed on 28 February or on 1 March.
Questions and answers
How do I work out an age on a particular date?
Subtract the year of birth from the year of the date, then take 1 off if the birthday has not yet come round in that year. Someone born on 20 October 1990 is 35 on 1 October 2026 and 36 from 20 October 2026. The leftover months and days are ignored for an age in years.
Why does dividing the days by 365 give a slightly different answer?
Because the period contains leap days. Ten years usually hold 3,652 or 3,653 days, so dividing by 365 gives a little over 10. Dividing by 365.25 is closer on average, but only anniversary counting tells you whether a whole year has been completed.
When does someone born on 29 February reach an age in a year with no leap day?
There is no universal answer. Some rules use 28 February and others use 1 March, and legal ages and scheme rules differ between countries. For a pension, a licence or any entitlement, check the official rule that applies to you instead of relying on a calculator.
Is my experience in years the same as the time between my first job and today?
Only if you have worked without breaks. Years between two dates measures the calendar span, including any gaps. For experience, add up the periods you actually worked, which the Work Experience Calculator does while counting overlapping jobs once.