Skip to content

Date Difference Calculator

Find the number of days between any two dates — with a year/month/day breakdown, weeks, and a business days count.

How date differences work in code

The standard convention in most programming languages is to count the days from the start date up to but not including the end date. This is sometimes called the half-open interval [start, end). In Python: (date(2026, 12, 25) - date(2026, 1, 1)).days returns 358, not 359. SQL's DATEDIFF follows the same rule. If you need an inclusive count, add 1.

The year/month/day breakdown accounts for varying month lengths, so “1 month” from January 31 lands on February 28 (or 29), not a fixed 30 days. This matches how relativedelta works in Python's dateutil library and Period in .NET — months are calendar months, not fixed 30-day chunks.

Frequently asked questions

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

Pick a start date and end date using the pickers above. The result updates instantly — no button to click. The total days, a year/month/day breakdown, and a week breakdown all appear at once.

Does the calculator include the end date?

No — it counts the days from the start date up to but not including the end date. This is the standard convention used in programming (e.g. Python's date subtraction, SQL DATEDIFF). If you want to include the end date, add 1 to the total.

What does the years/months/days breakdown mean?

It expresses the gap in the largest possible units first: for example 1 year, 3 months, 5 days means there is exactly that calendar distance between the two dates. This matches how you would describe the gap in natural language.

How are business days counted?

Business days are Monday through Friday. Weekends are excluded. Public holidays are not excluded because they vary by country — the business days figure is the universal Mon–Fri baseline.

Can I calculate the difference in the past or future?

Yes — the date pickers accept any date. The result always shows the absolute difference regardless of which date is earlier. The direction label (Start → End) tells you which comes first.

Related tools

Smart paste

Paste any timestamp or date, or search for a tool