Time/Numbers

Date Diff Calculator

Exact difference between two dates/times — calendar breakdown (years, months, days…), total duration, and business day count.


                    

This tool calculates the exact difference between two dates and times: a calendar breakdown in years, months, and days, a total duration in a single unit (just days or hours), and separately, the number of business days excluding weekends.

How to use it

Common uses

Things to keep in mind

A calendar difference (years/months/days) depends on the actual dates involved — months have different lengths, so "1 month" can mean anywhere from 28 to 31 days.

The business-day count only excludes Saturday and Sunday — public holidays need to be subtracted manually if they matter for your calculation.

Article about this tool: Date difference: why counting days is trickier than it looks

Frequently asked questions

Is the difference calculated inclusive or exclusive of the end date?

The tool calculates the astronomical difference between two points in time (exclusive) — so "from the 1st to the 3rd" gives 2 days, not 3. If you need the number of calendar days inclusive of both dates, add one day.

How are months and years of different lengths handled?

The calendar difference (years/months/days) is computed the way a person would count on a calendar: full years and months are subtracted first, accounting for their actual length, and the remainder is expressed in days.

What do "business days" mean?

The number of Monday-through-Friday days in the selected period. Public holidays aren't accounted for, since they differ by country.

Why might different tools give different month-difference results near short months?

Subtracting a month from a date that doesn't exist in the previous month (e.g. March 31 minus a month) is ambiguous — some libraries round down to the last day of February, others roll the extra days into March. Both are logical, but they give different answers.

Can I calculate the difference for dates before 1970?

Yes, the calculation isn't limited to the Unix epoch and works correctly for any calendar dates, including ones before 1970.

Articles: Time/Numbers

Unix time: why computers count time from 1970

Why January 1, 1970 became the reference point for time in most computer systems.

Cron expressions: how to decode a task schedule

How to decode an expression like */15 * * * * and know exactly when the job will run.

Number systems: why binary, octal, and hexadecimal exist

Why the color #FF5733 in CSS is written in hexadecimal digits instead of decimal.

Bitwise operations: how AND, OR, and XOR work at the bit level

How bitwise AND differs from logical AND, and why you'd operate on individual bits of a number at all.

Age calculation: why it's not just subtracting years

Why simply subtracting birth years can give an age one year higher than the real one.

Time zones: why UTC isn't the same thing as GMT

Why UTC never changes twice a year, while London time (GMT/BST) does.

Duration calculator: how to correctly add up hours, minutes, and seconds

Why adding minutes and seconds requires "carrying" the remainder to the next place, just like in decimal addition.

ISO 8601 duration: how to write a duration in a standard format

Why PT1H30M means "1 hour 30 minutes," not "1 minute 30 hours."

Week number: why different countries count weeks differently

Why January 1 sometimes falls into week 52 or 53 of the previous year under the ISO 8601 standard.

Roman numerals: how a system with no zero and no place value works

Why IV means 4, not 6, and how the subtraction rule works in Roman numerals.

IEEE 754: why 0.1 + 0.2 doesn't equal 0.3 in code

Why almost every programming language prints 0.1 + 0.2 as 0.30000000000000004.

Number to words: why turn digits into text

Why bank documents write an amount both in digits and in words at the same time.