Date Difference Calculator

Count the days between two dates, add or subtract time from a date, or work out an age. Every result is shown several ways at once — days, weeks, and calendar months — because the quickest way to spot a wrong answer is to see it disagree with itself.

Date difference calculator

Set the end date to

 

days

 

In months and days
In weeks and days
In weeks
From
To

 

 

Dates are counted on the proleptic Gregorian calendar, with no 1582 changeover, between 1800-01-01 and 2200-12-31. A calendar month has no fixed length, so the months-and-days answer is worked out by moving whole months first and counting the remaining days — which is why it never shows a fraction of a month.

This page saves nothing. Your dates stay in the page and are gone when you close the tab.

Advertisement

How this calculator works

Counting days between two dates is the easy half. Every date is converted to a day number counted from a fixed point, the two numbers are subtracted, and the answer is exact — leap years, month lengths and century rules are all already baked into the conversion. There is nothing to round and nothing to approximate, which is why the day count is shown largest on the page. It is the one output with no convention in it.

Everything else on that page involves a judgement call, and the interesting part of a date calculator is being honest about which ones it made.

The hard part: how long is a month?

A month has no fixed length. February is 28 or 29 days, other months are 30 or 31, and the average of 30.44 days is a statistic rather than a duration — no actual month is that long. So the question "how many months is it from 31 January to 1 March?" genuinely has more than one defensible answer.

This calculator uses the same rule as the reference implementations: move forward in whole months first, as far as you can go without passing the target date, and count whatever days are left over. From 31 January, one whole month lands on 28 February — because 31 February does not exist, the day is pulled back to the last day of the month it landed in. That leaves one day to 1 March. So the answer is 1 month and 1 day, and the day count for the same pair is 29.

When a month doesn't quite count as a month

There is one more twist, and it is the part most date calculators get quietly wrong. Ask for to and the whole-month step lands exactly on your end date — but only because the day had to be pulled back from the 31st. Nothing about those two dates is a clean month apart; February simply ran out of days first.

So we don't call it one. That pair is 28 days, not "1 month". The same applies to , which is 11 months and 30 days rather than a clean year.

The distinction is narrow and worth stating precisely, because the obvious simplification is wrong: this only applies when the pulled-back date is exactly your end date. If it lands short — as 28 February does when you asked for 1 March — the month genuinely completed and the leftover day is real, so stays 1 month and 1 day.

Those two numbers look inconsistent and are both correct. That is exactly why the page shows four different views of the same interval rather than one: the fastest way to notice that a date tool is broken is to see its own outputs contradict each other.

One thing this calculator will never show you is a fractional month. Weeks get a decimal, because a week really is seven days and half of one is a real quantity. Dividing days by 30.44 to get "1.13 months" produces a number that looks precise, cannot be checked by hand, and is not the answer to any question anyone asked.

Why adding a month and taking it away again does not get you back

Start on 31 January and add a month: you land on 28 February. Subtract a month from there and you get 28 January, not the 31st you started on. The operation is not reversible, and this is not a bug — it is a direct consequence of the day being pulled back to fit a shorter month. Every serious date library behaves this way, including the one built into browsers.

Because a user who tries it will reasonably assume the tool is broken, the add-and-subtract mode says so on screen whenever a day has actually been pulled back, using your own dates rather than a generic warning. The alternative — staying silent and being quietly surprising — is the worse option on a page whose whole purpose is arithmetic you can trust.

Why "today" is harder than it looks

When you press Today, the calculator asks your device for its time zone and works out the calendar date there. That sounds like an unnecessary detour, and it is the single most common source of off-by-one-day bugs in date tools on the web.

The tempting shortcut is to take the current instant and read the date off its standard machine representation. That representation is in UTC. If you are in Auckland it is already tomorrow for a large part of your working day; if you are in Honolulu it is still yesterday for a large part of yours. A tool taking that shortcut gives roughly a third of the world the wrong "today" for several hours a day, gives it confidently, and gives no indication anything happened. The fix is to ask for the local calendar date explicitly, which is what this page does. If your browser declines to report a time zone at all, the page says so rather than guessing.

Worked example: a project deadline

From to is 29 days — or 30 if you count the end date itself, which is what you want when you are counting how many days you will actually be working. The same interval is 4 weeks and 1 day, 4.14 weeks, or 1 month and 1 day. Four descriptions, one interval, and each is the natural answer to a slightly different question.

Worked example: a full year

From to is 364 days, which is exactly 52 weeks, and 11 months and 30 days. It is not 365, because you are measuring the distance between two points rather than counting the days in the year — the 365th day is 1 January the following year. Counting both endpoints gives 365, and the page shows that number alongside so you never have to work out which convention is in play.

How old is someone born on 29 February?

This calculator says that a person born on is still 17 on, and turns 18 the next day. It follows directly from the rule above: eighteen years from their birth date only reaches 28 February by pulling the day back from the 29th, and a year that completed only because the calendar ran out of days is not a completed year.

In a leap year nothing is pulled back, so the birthday falls on as you would expect.

It is worth being clear that this is a convention rather than a fact, and that the other one is perfectly reasonable: plenty of calendars treat 28 February as the birthday, which would make the same person 18 a day earlier. We follow the rule the reference implementation uses, and the page says so on screen whenever a birth date is 29 February rather than leaving you to find out. If an age matters legally, the convention that applies is the one in the relevant jurisdiction's law, not the one in a web page — and we deliberately do not cite one, because we have not verified any statute ourselves.

Limitations, stated plainly

  • Dates run from 1800 to 2200. Outside that range the calculator refuses and says so rather than clamping quietly to the nearest date it likes, because a silently changed input produces a confident answer to a question you did not ask.
  • The proleptic Gregorian calendar is used throughout. There is no Julian mode and no 1582 changeover, so dates before the Gregorian reform are counted as though the current calendar had always been in use. For historical research that is usually not what you want.
  • Whole days only. Times of day, time zones and daylight saving do not enter into it — this is calendar arithmetic, and the answer must not change because one of the days happened to be 23 or 25 hours long somewhere. For time-of-day questions use thetimer or the stopwatch.
  • Weekends and public holidays are not excluded. That is a different question, and a much harder one, because the answer depends on your country and often your region. A dedicated business-days calculator is planned.
  • This page saves nothing. Your dates stay in the page and are gone when you close the tab.

Sources

Advertisement

Questions

Should I count the end date?

It depends what you are counting. For "how many days until my flight" you want the plain difference. For "how many days am I away" you want both endpoints, because the day you leave and the day you come back are both days you are away. The page shows both numbers at once so the choice never changes the answer you are reading — it only changes which one is large.

Why does the months answer disagree with the days answer?

Because months have different lengths, so a count of months and a count of days genuinely measure different things. Counting the end date adds one to the day count, but it cannot change a calendar interval — the distance between two points does not have an endpoint convention. If the two ever moved together, one of them would be wrong.

Is the leap year handled?

Yes, including the century rule that catches most implementations out: 2000 was a leap year and 1900 was not, because a year divisible by 100 is only a leap year if it is also divisible by 400. Both are inside the range this calculator covers.

Why is 31 January plus one month the 28th of February?

Because 31 February does not exist, and the least surprising thing to do is use the last day of the month you landed in. The alternative — spilling over into 3 March — is worse, since it moves you into a different month from the one you asked for. It does mean the operation is not reversible, which the page points out when it happens.

Can I use it for someone's age?

Yes — switch to Age mode, enter a date of birth, and it shows completed years plus the exact years, months and days, the total days lived, and when the next birthday falls. Ages are counted in completed years, which is the everyday meaning: you are 17 until the day you turn 18, not from the moment you are closer to 18 than 17.

Does it work without JavaScript?

The page and all of the text load and render without it, but the calculator itself needs it — the arithmetic runs in your browser rather than on a server, which is also why nothing you type is ever sent anywhere.

Are the answers checked against anything?

Yes, and this is the part worth knowing. The calendar arithmetic is compared automatically against the reference implementation built into modern browsers, over roughly a million pairs of dates concentrated on the end-of-month cases where implementations actually differ, every time the site changes. That check was written after it found a real disagreement in our own code — which is the honest reason to trust it more than a claim of care.