Skip to content
FindTool

    Date Difference Calculator

    Measure the span between two dates in years, months, weeks, days, hours and seconds.

    Date Difference Calculator tool

    What this tool does

    Give it two moments and it measures the gap twice, because there are two honest answers. The calendar answer — "2 years, 4 months and 9 days" — is how people talk about age, tenure and contract length. The total answer — "856 days" or "20,544 hours" — is what you need when the unit has to stay constant, as in billing, SLA windows and retention policies. Both come from the same pair of instants, so they never disagree; they describe the same span with different rulers.

    Common uses

    • Working out someone's exact age, or how long an employee has been in post.
    • Counting the working days available before a deadline, which is nearly always what a project plan means by "ten days".
    • Checking whether a certificate, token or licence has an acceptable remaining life.
    • Converting a retention rule expressed in months into the day count a cron job or a database DELETE actually needs.

    A short example

    From 31 January to 1 March in a leap year:

    Calendar   1 month, 1 day
    Totals     30 days · 4 weeks · 720 hours
    Business   22 business days, 8 weekend days

    One month, not thirty days. Adding a month to 31 January lands on 29 February — the 31st does not exist in February, so the date is clamped to the end of the month — and one further day reaches 1 March.

    Why months are the awkward unit

    A month has 28, 29, 30 or 31 days, so "one month" is only defined relative to a starting date. Every serious date library resolves this the same way, and so does this tool: walk whole months forward from the start, clamping the day-of-month when the target month is shorter, then measure whatever is left in exact days, hours, minutes and seconds. That is why "whole months" in the totals grid can differ from days ÷ 30.

    Business days are counted on the half-open interval: the start day counts and the end day does not, which is what makes Monday to Tuesday a single business day. Tick "count the end day as well" for the payroll convention, where Monday to Friday is five. Public holidays are not deducted — they differ by country, region and year, and guessing would be worse than leaving the number honest.

    Worth knowing

    Both inputs are read as plain wall-clock readings in the same zone, so daylight saving never adds or removes an hour from the result. That is almost always what you want: if a meeting moves from 09:00 on 1 March to 09:00 on 1 April, the answer should be one month exactly, not "one month minus an hour". If you need the elapsed physical time across a DST boundary, convert both ends to UTC first with the timezone converter and compare those.

    Frequently asked questions

    Why does a spreadsheet report a different number of days?

    Spreadsheets subtract serial numbers, and Excel’s serials carry a deliberate defect: 1900 is treated as a leap year so that 29 February 1900 — a date that never existed — occupies serial 60, inherited from Lotus 1-2-3 for compatibility. Any span crossing early 1900 therefore comes out one day long, and Google Sheets copies the behaviour. Microsoft also documents that DATEDIF with the MD unit can return a negative result.

    Which SQL function gives which of these two answers?

    In PostgreSQL, subtracting one date from another returns whole days as an integer, while age(a, b) returns the calendar breakdown in years, months and days. MySQL separates them too, with a trap: DATEDIFF(a, b) gives a minus b in days and discards the time part entirely, whereas TIMESTAMPDIFF(unit, a, b) takes its arguments the other way round and truncates towards zero.

    How many working days are there in a year?

    A 365-day year is 52 weeks plus one day, so it holds 260 or 261 weekdays depending on which day it starts; a leap year starting on a Thursday or Friday reaches 262. 2026 opens on a Thursday and contains 261. Subtract your own public holidays from whatever this tool reports — eight statutory days in England and Wales, eleven US federal holidays — because only weekends are excluded here.