Date difference calculator
Count the number of days between two dates.
Enter both dates to see the result.
Guide to Date Difference
How does the date difference calculator work?
The date difference calculator calculates the number of days between two selected dates. You can calculate both future and historical dates. The result can be positive (when the end date is later) or negative (when the end date is earlier). The difference is calculated to the exact day.
Date formats
In Poland, the format DD.MM.YYYY (day.month.year) is used, while in the USA the format MM/DD/YYYY dominates. The ISO 8601 format (YYYY-MM-DD) is used in international systems, which is unambiguous and universal. Using consistent date formats in calculations is important.
Practical applications
- Calculating time until important events (birthdays, anniversaries)
- Planning projects and deadlines
- Calculating pregnancy duration (counting from last period)
- Setting document expiration dates
- Counting business days between dates
Important dates of the year
There are dates of special significance in the calendar: New Year's Day (January 1), Grandparents' Day (January 21-22), Valentine's Day (February 14), Women's Day (March 8), Children's Day (June 1), Christmas Eve (December 24), and New Year's Eve (December 31). The date calculator is useful for planning vacations and business trips.
1 January to 31 December is 364 days, not 365
Subtracting two dates gives the gap between them, not the number of days involved. From 1 January to 31 December is 364 days of difference but 365 days of calendar. Which number you want depends on whether you are measuring an interval or counting days, and mixing them up is the oldest off-by-one error there is.
How it works
- Finds the exact number of days, weeks and months between two dates.
- Distinguishes the difference between dates from the inclusive count of days.
- Handles leap years correctly, including the century rule that skips 2100.
difference = end − start inclusive count = end − start + 1 use the difference for durations: nights, interest periods, notice use the inclusive count for occupancy: days present, days billed
Worked example
The same pair of dates read two ways, plus a leap-year check.
- 2026-01-01 → 2026-12-31 = 364 days difference
- the same span counted inclusively = 365 days
- 2026-01-01 → 2027-01-01 = 365 days
- 2024-01-01 → 2024-12-31 = 365 (2024 is a leap year)
- 2100-01-01 → 2100-12-31 = 364 (2100 is not)
A hotel booking makes the distinction concrete: a ten-night stay spans eleven calendar days. You are billed for the difference and present for the inclusive count, and the two numbers are never equal.
Reading the result
- Interest, rent and notice periods use the difference. A thirty-day notice period served from the 1st ends on the 31st, and counting inclusively would end it a day early — which is exactly the kind of error that reaches a tribunal.
- Attendance, occupancy and billing by day use the inclusive count. Someone in hospital from Monday to Friday was there five days, even though the difference is four.
- Month arithmetic has no single correct answer at the ends. One month after 31 January is 28 or 29 February in most systems, so adding a month and subtracting one does not always return the starting date.
- Time zones can shift a date difference by a whole day. Comparing timestamps captured in different zones without normalising first produces off-by-one results that appear only for users in certain regions.
Common questions
- Should I add one to the result?
- Only if you are counting days rather than measuring a gap. Ask what the number is for: nights, interest and notice take the plain difference; days attended, days billed and days present take the difference plus one.
- Does the calculation handle leap years?
- Yes, including the century exception. 2024 has 366 days so 1 January to 31 December is 365; 2100 is not a leap year despite being divisible by four, so the same span is 364.