What a date calculator does, and where the shortcuts break
A date calculator answers two questions that look trivial and are not. How far apart are these two dates, and what date is this many days, weeks, months or years from that one. Counting on your fingers works for a week. Past that, month lengths, leap years and the inclusive-or-exclusive question start doing quiet damage.
Three things go wrong when it is done by hand.
- Month lengths. Treating a month as 30 days is wrong eleven months out of twelve. Over a year the drift is about five days, which is enough to miss a deadline.
- Leap years. Any range that crosses a 29 February is a day longer than the same range in a common year. A year is divisible by 4 and is a leap year, unless it is a century year not divisible by 400, which is why 1900 was not one and 2000 was.
- The fencepost. The gap between 1 March and 8 March is 7 days, but a trip starting on the 1st and ending on the 8th covers 8 calendar days. Both are right, for different questions, and picking the wrong one is the commonest date mistake there is.
The clock change bug
There is a fourth failure that only shows up in software. The obvious way to count days in code is to subtract two timestamps and divide by 86,400,000, the number of milliseconds in a day. On the two days a year a region changes its clocks, one local day is 23 hours long and another is 25, so that division returns 6.96 days where it should return 7, and a rounding step turns that into the wrong integer.
This page never divides milliseconds. Each date becomes a day number on the Gregorian calendar and the integers are subtracted, so the answer is the same in every time zone and whether or not a clock change falls inside the range. The dates carry no time of day, which is what a birthday or a deadline actually is.
Which of the numbers on screen is the one you want
The difference between two dates is shown four ways at once, because the right unit depends entirely on what the number is for.
- Days is the one to use for anything with legal or financial weight: payment terms, notice periods, visa windows, interest. A day is always a day, which is not true of a month.
- Weeks and days suits pregnancy, training plans, sprint planning and anything already scheduled in weeks.
- Months and days and years, months and days are counted on the calendar rather than on an average month. They suit an age, a tenancy, a length of service or a subscription term.
- Weekdays only counts Monday to Friday and skips every weekend in the range. Use it for working days, delivery estimates and turnaround times, and read the caution about holidays below before you quote it to anyone.
The include-the-end-date switch
Off is the default and gives the exclusive count, the gap between the two dates. On gives the inclusive count, which is one higher, because both the first and the last date are counted as whole days.
Leave it off for durations: nights in a hotel, days of accrued interest, the time remaining until a deadline. Turn it on for occupied days: holiday allowance, days spent in a country, a rental billed per calendar day, anything a contract describes as inclusive. The switch moves every line on the card at once, so the weeks, the months and the weekday count never disagree with the day count.
Counting the days between two dates
- Open the Days between dates tab. The start date is filled in with today in your own time zone.
- Set the start and end dates. On a phone both fields open the native date picker.
- Decide on the end date. Tick Include the end date if both dates should be counted as whole days.
- Read the line that matches your question. The big number is days; the rows below restate the same span in weeks, in calendar months, in years and months, and in weekdays.
Entering the dates the wrong way round is not an error. The tool reports the gap and labels the result so you know the end date is the earlier one. Swap dates puts them back in order.
Adding or subtracting days, weeks, months and years
- Open the Add or subtract tab and set the start date, which again defaults to today.
- Choose Add or Subtract, type a whole number, and pick days, weeks, months or years.
- Read the result, which is given with its weekday, in ISO form for pasting into a system, and with the total offset in days.
The weekday is there because it is usually the reason for the question. A payment due 90 days out that lands on a Sunday is not really due on a Sunday, and a 6 week appointment that falls on a Saturday needs moving before anyone books it.
What happens at the end of a month
Add one month to 31 January and there is no 31 February to land on, so the day is clamped to the end of the target month: 28 February, or 29 February in a leap year. That is the convention spreadsheets use, and the page says so on screen whenever it happens.
Clamping does not reverse. Subtract a month from that 28 February and you land on 28 January, not back where you began. If a deadline has to survive that round trip, count it in days.
Getting the answer out of the page
Each tab has a Copy result button. On the difference tab it copies a short labelled block: the two dates, the end date setting, and every unit on the card, one per line. On the add and subtract tab it copies the calculation, the result in long form, the result as an ISO date, and the offset in days.
Copying labelled lines rather than a bare number is deliberate. Pasted into a ticket or an email, a lone 74 is unreadable a week later, while “Days: 74, end date not included” still carries the assumption that produced it. Paste with Ctrl+V on Windows, Cmd+V on a Mac, or press and hold and choose Paste on a phone.
The ISO date on the second tab, in the YYYY-MM-DD form, is the one for a spreadsheet, a database field or a filename. It sorts correctly as plain text and it is unambiguous everywhere, unlike 03/04/2026, which is two different days depending on who reads it.
Where the same question gets a different answer
Date arithmetic is not standardised across the tools you will compare this against, so a mismatch is usually a definition difference rather than a bug.
- Spreadsheets subtract dates as serial numbers, so a plain subtraction gives the exclusive count that this page shows by default. Their working day functions take an explicit list of holidays as an argument, and return 0 holidays if you leave it out.
- Weekends are not universal. Monday to Friday is the common pattern, but the weekend is Friday and Saturday in much of the Middle East and parts of North Africa, and some countries use a Saturday half day. The weekday count here is fixed to Monday through Friday.
- Date formats differ by country. This page writes dates in US English long form and in ISO form, and never in the ambiguous all-numeric style, precisely because 03/04 is March in some places and April in others.
- Airlines, hotels and rentals count nights, which is the exclusive count, while immigration rules and holiday allowances count days of presence, which is inclusive. Same switch, read two ways.
- Historic dates are extended backwards on the modern Gregorian calendar, which countries adopted at different times between 1582 and 1923.
Limits worth knowing before you rely on a number
- No holiday data. The weekday count removes weekends and nothing else. National holidays, bank holidays, company shutdowns and religious observances are not known to this page, and they move between countries and between years. Treat the weekday figure as the maximum number of working days and subtract your own calendar.
- No times, and therefore no time zones. Dates here have no hour attached. If you need the hours between two moments in different cities, that is a time zone problem, not a date problem.
- Months are calendar months. A month is between 28 and 31 days, so the months line and the days line will not divide into each other. Anything that needs a fixed 30 day month should be counted in days.
- Legal deadlines have their own rules. Contracts and jurisdictions define whether the first day counts, whether a deadline lands on a weekend rolls forward, and whether business or calendar days are meant. Those rules override any general-purpose calculator, this one included.
- The range is limited to the years 1 through 9999, which is what date inputs and date formatting reliably handle.
Nothing here is legal, financial or medical advice. Use this page to do the counting, and the relevant authority to confirm which counting rule applies.
Frequently asked questions
How do I count the number of days between two dates?
Put the earlier date in the start field and the later one in the end field, and the day count appears straight away. By default the count is exclusive: from 1 March to 8 March is 7 days, because it counts the nights between the two dates rather than the dates themselves. Tick "Include the end date" if you need both dates counted, which turns the same pair into 8 days. If you enter the dates the wrong way round the tool still gives the gap, it just tells you the end date is earlier.
Should I include the end date or not?
It depends on what the number is for. Leave it off for durations: nights in a hotel, days of interest, notice periods, the gap until a deadline. Turn it on for anything counted as occupied days: holiday allowance, days of jury service, the length of a trip described as "how many days was I there", a rental charged per calendar day. The wording to look for in a contract is inclusive, which means both the first and the last day count. Whichever you choose, use the same rule for every date range in the same calculation.
How many weekdays are there between two dates?
The weekdays line counts Monday to Friday only and skips every Saturday and Sunday in the range, following the same include-the-end-date setting as the rest of the results. It has no holiday data at all, so it does not know about national holidays, bank holidays, company shutdowns or religious observances, and it does not know about weekends that fall on Friday and Saturday in parts of the world. Treat it as the upper bound of the working days available, then subtract the holidays your own calendar shows.
How do you add one month to 31 January?
The result is 28 February, or 29 February in a leap year. There is no 31 February, so the day is clamped to the last day of the target month, which is the same convention spreadsheets and most date libraries use. One consequence is worth knowing: clamping is not reversible. Add one month to 31 January and you get 28 February; subtract one month from that and you get 28 January, not the date you started from. If a contract or a deadline depends on the exact day, count in days rather than months.
Does this handle leap years and 29 February?
Yes. The arithmetic uses the full Gregorian leap year rule, so a year divisible by 4 is a leap year except a century year that is not divisible by 400. That is why 2000 was a leap year and 1900 was not, and why the next skipped one is 2100. Day counts across any 29 February are therefore exact. Adding a year to 29 February gives 28 February in the following common year, again because the day is clamped rather than rolled forward into March.
Do daylight saving time changes affect the day count?
Not here. A common bug in homemade date calculators is to subtract two timestamps and divide by the number of milliseconds in a day. On the two days a year a region changes its clocks, one day is 23 hours long and another is 25, so that division quietly gains or loses a day. This page never divides milliseconds. It converts each calendar date to a day number and subtracts the integers, so the answer is the same whether or not a clock change falls inside the range and whatever time zone you are in.
Which time zone does the calculator use?
None of them, in the sense that matters. The dates you type are treated as plain calendar dates with no time of day attached, which is what a birthday, a deadline or a contract date actually is. The only place your device settings come in is the date the page fills in when it loads, which is today in your own time zone. If you need a wall clock time converted between cities, that is a different job and the time zone converter does it.
How do I work out the date 90 days from today?
Open the "Add or subtract" tab. The start date is already set to today, so choose Add, type 90, leave the unit on Days, and the result appears with its weekday. Because payment terms, visa windows and notice periods are usually written in days rather than months, counting in days is the safer choice for anything with legal weight: 90 days is always 90 days, while 3 months is a different number of days depending on which months they are.
Is a month 30 days here?
No. Months are counted on the calendar, so a month is however long the actual month is, between 28 and 31 days. That is why the months line and the days line describe the same span in two ways that do not divide neatly into each other: 1 January to 1 March is 2 months and also 59 days in a common year, which is not 2 times 30. If you specifically need 30 day months, count in days and divide yourself, and say so in whatever you are filling in.
Does anything I type get sent anywhere?
No. Every calculation runs in your browser as you type, and the dates are not written into the address bar, saved to the page or sent to a server, so a link you copy carries the tool and not your dates. That matters more than it sounds for this particular tool, because the dates people put into it are often a due date, a court date, a visa expiry or a medical appointment.
Sources
- The leap year rule and the structure of the proleptic Gregorian calendar are the basis of the day-number conversion used here. ISO 8601 defines the
YYYY-MM-DDcalendar date form; the same form is specified for internet timestamps in RFC 3339. - The millisecond-division pitfall follows from the behaviour of JavaScript dates, documented on MDN.
- Daylight saving rules and their history per region come from the IANA Time Zone Database, published at iana.org/time-zones. This page does not use it, because it does not use clock time.
- Date and number formatting is produced by the browser through the ECMAScript Internationalization API, with the locale pinned to
en-USso the wording does not change with the reader’s device settings.
More date tools
If the start date is a birthday, the age calculator gives the exact age in years, months and days and the days to the next birthday. To watch a future date approach rather than count it once, the countdown timer runs live. When the question involves clock time in another city, use the time zone converter, and for Unix epoch values in logs and databases, the timestamp converter.
Related tools
- Age Calculator
Enter a birth date to get your exact age in years, months and days, total days and hours, …
- Countdown Timer and Age Calculator
Count down to any date in days, hours, minutes and seconds, or enter a birth date to get a…
- Time Zone Converter
Convert a time across 90 world cities at once, from New York and London to Tokyo and Sydne…
- Unix Timestamp Converter
Convert Unix epoch timestamps to human dates and back, in your local time zone and UTC.
Privacy: every calculation runs in your browser. The dates you enter are never sent to a server, never stored, and never written into the address bar, so a link you copy carries the tool and not your dates.
