Date & time Works offline

Date Difference Calculator

Count the days, weeks, months and working days between any two dates — with optional times, an include-the-end-date toggle and a holiday list you paste yourself.

Dates

Both dates default to today, so the first figure you see is a same-day result. Everything is calculated on your own device clock and nothing is uploaded.

How it works

Type a start date and an end date and the tool reports the same gap in several different ways: as a calendar breakdown of years, months and days, as a total number of days, as whole weeks plus a remainder in days, as elapsed hours and minutes, and as working days with weekends and any holidays you list removed. Both time fields are optional. Leave them empty and the dates are treated as starting at midnight; fill one in and the arithmetic becomes precise to the minute.

The calendar breakdown is the part that most day-counting tools get wrong. It is not produced by dividing the total number of days by 30 or by 365.25. Instead the tool walks the calendar forward from the start date: it adds whole years while they still fit, then whole months while they still fit, and finally counts the leftover days one by one until it reaches the end date. That is the same borrowing a person does mentally — 3 March 2024 to 18 July 2025 is 1 year, 4 months and 15 days, because 3 March 2025 is one year, 3 July 2025 is four months after that, and 18 July is fifteen days later.

Totals come from a different route: elapsed milliseconds between the two instants, obtained from the browser's own date arithmetic and then divided into days, hours and minutes. Working days are counted separately by stepping over each calendar day in the period, skipping Saturday and Sunday, and skipping any date your holiday list contains. The two methods are deliberately kept apart so that a weekday count never has to agree with a fractional day count.

"Include the end date" only affects the totals. Switch it on and a single day is added to the elapsed time, which turns a 1 June to 3 June range from 2 days into 3. The years, months and days breakdown describes the distance between two instants, so it is unchanged — 1 June to 3 June is always "2 days" as a difference, and 3 days when the last day is counted as a whole day of the period.

Accuracy and the limits of counting days

The commonest source of error in date arithmetic is the difference between a day and 24 hours. Days are counted on the calendar: from local midnight to local midnight, whatever the clock does in between. When daylight saving starts or ends, that stretch is 23 or 25 hours, so for any period covering a clock change the elapsed hours are not the day count multiplied by 24. This tool keeps the two separate for exactly that reason, and reads the daylight-saving rules from the time zone your device is set to.

Weekends are a convention, not a fact. Saturday and Sunday are excluded because that is the Monday-to-Friday working week in most of Europe and the Americas, but Israel, much of the Middle East and parts of Asia use Friday and Saturday or Sunday through Thursday. Public holidays vary even more: they differ by country, by region, by year, and some are moved or announced at short notice. Nothing here is guessed from a calendar of national holidays, so for anything official you should still confirm the count against the holiday list that applies to you.

The tool is also indifferent to what a "month" means in a contract. A period of one month may be defined as the same day number in the next month, as 30 days, or as a whole calendar month including both ends. If you are calculating a legal deadline, a notice period, a visa window or anything else with a contractual definition, use this page to get a quick figure and then check it against the wording that governs you, or against a lawyer or the issuing authority.

Very early dates are approximate. Devices and libraries disagree about the proleptic Gregorian calendar, so entering a date before 1582 or before your country adopted the Gregorian reform can give a result that is off by the days that were skipped. Ten-digit-year edge cases and clocks set to the wrong time zone will also shift a boundary date by one day.

How to use it

  1. Set the start date. Both date fields begin at today, so if you are counting from today you can leave the first one alone.
  2. Set the end date, then add times only if they matter. A shift from 09:00 to 17:00 on the same date is 8 hours, not a whole day, and the totals will reflect that.
  3. Decide whether the last day counts. Tick the box for hotel nights, rental periods, notice periods and deadline wording such as "within 14 days of the date of this letter". Leave it clear when you want the distance between two dates, as in most anniversary and duration questions.
  4. Paste your holidays, one YYYY-MM-DD date per line, if you need a working-day count rather than a calendar-day count. The line under the box tells you how many valid dates were accepted and flags anything it could not read.
  5. Use Swap the two dates to flip the direction when you entered them the wrong way round. Everything recalculates instantly and the sentence above the figures updates as you type.

A worked example: to count how many working days remain between today and a deadline, set the start to today, the end to the deadline, tick the box if the deadline day itself counts as a working day, and paste your remaining public holidays. The "Working days" tile is the answer, and the sentence above it gives you the calendar gap to quote in your reply.

Frequently asked questions

How are the years, months and days worked out?

They are counted on the calendar, not by dividing your total days. The tool takes the start date, adds whole years until it can add no more without overshooting, then adds whole months the same way, and finally counts the leftover days one at a time. That is why 3 March 2024 to 18 July 2025 gives 1 year, 4 months and 15 days rather than a decimal figure — 487 total days divided by 30.44 would be a different and less useful answer. This borrowing of months and days is the same approach a person takes when counting an anniversary by hand.

Does the tool count the end date itself?

Only if you ask it to. By default the two dates are treated as points on a line, so a stay from 1 June to 3 June is 2 days. Switch on “Include the end date in the totals” and the end of that period is counted as a full day, making it 3 days, which is what you usually want for hotel nights, rental periods, notice periods and deadlines such as “you have 14 days from today”. The calendar breakdown in years, months and days is a distance between two instants, so it stays the same either way; only the totals change.

Which days count as working days?

The tool counts every weekday that falls inside the period and skips Saturday and Sunday, which is the Monday-to-Friday convention used in most of Europe and the Americas. Because weekends differ by country and region, there is no “correct” answer baked in — if you work a Sunday-to-Thursday week, subtract the difference yourself or read the total days figure and adjust. Public holidays are never guessed, so paste the ones that apply to you into the holiday box, one YYYY-MM-DD per line, and they will be removed from the count as well. Blank lines and duplicate lines are ignored.

Why do the hours differ from the days multiplied by 24?

Because days are counted on the calendar and hours are counted as elapsed time. The working days exclude weekends, and daylight saving transitions make one or two days in the year 23 or 25 hours long, so multiplying the total days by 24 would be slightly off for any period that crosses a clock change. If you leave both time fields empty the totals are whole days and the hours are exact; as soon as you enter a start or end time, the total days figure becomes a decimal and the hours and minutes come from the real elapsed milliseconds instead.

Sources & further reading

  • MDN Web Docs — Date — The reference for the date arithmetic used here, including the local-time constructor, the daylight-saving edge cases and why getTime() differences are the safe way to measure elapsed time.
  • IANA time zone database (tz database) — The authoritative record of the daylight-saving and offset changes that make some calendar days 23 or 25 hours long, which is why elapsed hours are not simply days multiplied by 24.
  • Wikipedia — ISO 8601 — Describes the YYYY-MM-DD calendar-date format expected in the holiday box and the week-numbering conventions behind Monday-to-Sunday weeks.