← All guides

How to Calculate Days Between Dates, Ages and Leap Years

Date calculations are deceptively tricky. Months have different lengths, years are not all the same length, and the question of whether to include the start date, the end date or both changes the answer. Whether you are counting down to an event, working out someone's exact age, calculating a notice period or planning a project timeline, getting the numbers right requires a consistent approach.

Try the free Datefully date calculator: open the tool.

How to count days between two dates

The most straightforward date calculation is counting the number of days between a start date and an end date. The answer depends on whether you are measuring elapsed time or counting inclusive days.

Elapsed time — the number of days that have passed — excludes one of the boundary dates. From 1 January to 2 January, one day has elapsed. This is the most common interpretation for questions like "how many days until my holiday?" or "how long ago was that event?".

Inclusive counting — used in some legal, contractual and statutory contexts — counts both boundary dates. From 1 January to 2 January inclusive is two days. Always check which convention applies when the answer has consequences.

Why months make date maths complicated

A common shortcut is to assume every month has 30 days and multiply. This produces quick estimates but inaccurate results over longer periods. February has 28 days in most years and 29 in a leap year. January, March, May, July, August, October and December have 31 days. April, June, September and November have 30. Any calculation that crosses a month boundary must account for the actual length of that month.

This is why "three months from 31 January" is ambiguous — 30 April is the nearest valid date, but some contexts might mean 28 February or 3 May depending on the convention used. A date calculator avoids this ambiguity by working with actual calendar dates.

Leap years explained

A solar year — the time it takes the Earth to orbit the Sun — is approximately 365.25 days. The Gregorian calendar handles this by adding an extra day (29 February) to most years divisible by four. These are leap years.

However, the solar year is not exactly 365.25 days, so two correction rules apply. Century years (1800, 1900, 2100) are not leap years even though they are divisible by four. But years divisible by 400 (1600, 2000, 2400) are leap years. So 2000 was a leap year, 1900 was not, and 2100 will not be.

In practice, leap years affect date calculations whenever a date range crosses 29 February. The difference between 1 January and 1 March is 59 days in a regular year and 60 days in a leap year.

Calculating someone's exact age

Age is conventionally counted in completed years — the number of times a person's birthday has occurred before today's date. This means a person born on 29 February in a leap year has a birthday on the calendar only every four years; their age still increments once per year, on either 28 February or 1 March depending on local convention.

To calculate an exact age in years, months and days: count the completed years first (how many times has the birth month and day passed?), then the remaining completed months, then the remaining days. A date calculator does this consistently regardless of month lengths or leap years.

Working days and business days

Many date calculations in a work or legal context require working days rather than calendar days. A working day typically excludes weekends and public holidays. The number of working days between two dates depends on which days of the week fall in the range and which public holidays apply — which themselves vary by country, region and employer.

For working day calculations, use the Workday Count tool, which excludes weekends and allows you to subtract additional holidays.

Practical examples

How many days until a future date?

Count from today's date to the target date, excluding today (elapsed days). If today is 1 March and your event is on 15 March, the answer is 14 days. A date calculator does this instantly for any pair of dates.

How long ago did something happen?

The same calculation applies in reverse. The result in days can be converted to weeks and days, months, or years and months depending on the scale of the interval.

Adding or subtracting days from a date

Adding 90 days to 1 January gives 1 April in a non-leap year (31 days in January, 28 in February, 31 in March = 90 days). In a leap year, 29 February adds an extra day, so 90 days from 1 January lands on 31 March instead.

Common questions about date calculations

Why do different calculators give different answers for the same dates?

The most common reason is the inclusive versus exclusive boundary convention. One calculator may count from the start date, another from the day after. Check which interpretation the tool uses and whether it matches your requirement.

How do I calculate the number of months between two dates?

Count the completed calendar months between the start and end dates. Partial months at the start or end of the range may or may not be counted depending on the context.

Does daylight saving time affect date calculations?

Not when only calendar dates are involved. Daylight saving matters only for calculations that include times as well as dates, and only when crossing a clock-change boundary.

How do I work out what day of the week a date falls on?

A date calculator can tell you the day of the week for any date. Alternatively, several algorithmic methods exist (such as the Doomsday algorithm) for mental calculation, though they require practice.

What is the difference between a date and a datetime?

A date specifies a calendar day with no time component. A datetime specifies both a date and a time, usually to the second or millisecond. Date-only calculations are simpler; datetime calculations must also handle time zones and daylight saving transitions.

Related tools and guides

Use Datefully to calculate days between any two dates, work out ages and explore date differences. For counting working days specifically, use Workday Count. Browse all LibraireStudios guides for more practical help.

LibraireStudios tools are designed for everyday planning and general information. For date calculations with legal, contractual or statutory consequences, verify the applicable convention and any relevant public holiday rules with an appropriate authoritative source.