The basic method: subtract the dates
The number of days between two dates is the later date minus the earlier one, with each date turned into a count of days. A computer does this by giving every date a day number, as 20 October 2026 is day 20,746 counted from 1 January 1970, and subtracting. By hand, add up three pieces: the days left in the start month, the whole months in between, and the days into the end month.
- Days left in the start month. October has 31 days, so after the 20th there are 11 left.
- Whole months in between. November has 30 days.
- Days into the end month. December 25 is 25 days in.
- Add them: 11 + 30 + 25 = 66 days, which matches 66.
Count the end date or not?
The subtraction method gives the difference, which leaves out one end of the range. Today to tomorrow is one day, even though two dates are involved. That matches how most people count a gap: 66 days from October 20, 2026 to December 25, 2026. If both the first and the last day count, as for days of leave or a conference, add one: 67.
| Situation | Count | Example from 20 to 25 October |
|---|---|---|
| Days until an event, age in days | Exclusive (subtract) | 5 days |
| Days of leave, conference days, a stay where each calendar day counts | Inclusive (add one) | 6 days |
| Nights in a hotel | Exclusive | 5 nights |
| A legal or contractual period | As the document defines it | Read the clause |
Contracts and laws often say whether the first day counts, for example “within 30 days of the date of the notice” usually starts the count on the day after. This guide cannot tell you which rule applies to your deadline. Check the wording, and if the stakes are high ask the body that sets the deadline.
Years, months and days: where tools disagree
Days between dates is unambiguous. Years, months and days is not, because months have different lengths. The date calculator on this site adds whole months to the earlier date for as long as that does not pass the later one, then counts the days left. For October 20, 2026 to December 25, 2026: two whole months takes you to December 20, 2026, a third would pass the end, and 5 days remain, so the answer is 2 months, 5 days.
The awkward case is a month end. There is no 31 February, so adding one month to January 31, 2026 gives February 28, 2026, the last day of February. The calculator moves a date back to the last day of a shorter month, which is also what most databases and calendar libraries do. The gap from January 31, 2026 to March 1, 2026 then comes out as 1 month, 1 day. Another tool could count it as one month and a day, or as 29 days, and not be wrong, only different.
Leap years
A year is a leap year when it divides by 4, except for century years, which must divide by 400. So 2024 and 2000 were leap years, and 1900 and 2100 are not. A leap year has 366 days, with 29 days in February, and that day is why a day count between two dates is not simply years times 365. From 1 January 2000 to October 20, 2026 is 9,789 days, which is 26 years, 9 months, 19 days. Twenty-six whole years of 365 days would be 9,490; the 292 days from 1 January to October 20, 2026 are added, and 7 more come from the leap days of 2000, 2004, 2008, 2012, 2016, 2020 and 2024.
Adding a year to 29 February also needs a rule. The calculator moves it to February 28, 2025, the last day of February in a year that has no 29th.
Weekdays only
For business use you may want only Monday to Friday. Count the whole weeks (each has five weekdays) and then the leftover days one by one. Between October 20, 2026 and December 25, 2026, counting both ends, there are 49 weekdays. This does not remove public holidays, which differ by country and year. The working days calculator lets you pick your own weekend and add holidays, and the date calculator’s “weekdays” figure is a Monday-to-Friday count with nothing taken out.
Working days calculatorTo take out public holidays, or to use a Friday and Saturday weekend, use the working days calculator.The same calculation in a spreadsheet, a database and code
Many people searching for this want a formula. These all give 66 for 2026-10-20 to 2026-12-25; the date calculator writes them out for your own dates.
| Where | Formula |
|---|---|
| Excel or Google Sheets (dates in A1 and B1) | =B1-A1 |
| Excel or Google Sheets, same result | =DATEDIF(A1,B1,"d") |
| Excel or Google Sheets, weekdays only | =NETWORKDAYS(A1,B1) |
| PostgreSQL | SELECT DATE '2026-12-25' - DATE '2026-10-20'; |
| MySQL | SELECT DATEDIFF('2026-12-25', '2026-10-20'); |
| SQL Server | SELECT DATEDIFF(day, '2026-10-20', '2026-12-25'); |
| SQLite | SELECT julianday('2026-12-25') - julianday('2026-10-20'); |
| Python | (date(2026, 12, 25) - date(2026, 10, 20)).days |
| JavaScript | Math.round((Date.UTC(2026, 11, 25) - Date.UTC(2026, 9, 20)) / 86400000) |
To add 30 days: in a spreadsheet use =A1+30, in PostgreSQL SELECT DATE '2026-10-20' + 30, and in Python add timedelta(days=30). The result for October 20, 2026 is November 19, 2026. In JavaScript, build dates with Date.UTC and divide the difference by 86,400,000, because local-time dates can be off by an hour across a daylight saving change and produce a fractional day.
Week numbers and weeks between dates
Weeks between dates is the day count divided by seven, with a remainder: 66 days is 9 weeks and 3 days. A week number is a different idea. The ISO 8601 standard starts weeks on Monday and calls the week that holds the year’s first Thursday week 1, so the first days of January can belong to week 52 or 53 of the year before. Friday, January 1, 2027 falls in ISO week 53 of 2026. The US convention of counting weeks from Sunday gives different numbers around the new year, so say which you mean when a deadline is given as a week.
A checklist before you trust the answer
- Is the end date counted? Decide, and say it.
- Are you counting calendar days, or business days with holidays removed?
- If the answer will go into a contract, a visa or a court date, have the wording checked by whoever sets the deadline.
- Does a time zone matter? A deadline at midnight in one place is a different day somewhere else. The calculator works with plain dates and clock times, with no time zone.
- If a formula and a calculator disagree, test the formula on a pair of dates whose answer you can count by hand.
A final check: December 25, 2026 should equal December 25, 2026, because 66 days after 2026-10-20 is 2026-12-25. Counting forward and back should always land on the same date.
Common questions
How many days are there between two dates?
How do I count the days between two dates in Excel?
Is the end date included when you subtract?
How many days are in a leap year?
What date is 30 days from today?
How do I get the number of weekdays between two dates?
Sources
Reviewed on 20 Oct 2026 against the published sources below. Laws and prices change, so check the current position before you rely on a figure.
- Microsoft Support: DATEDIF function (units, and the warning against the MD argument)
- Wikipedia: ISO 8601 week date (weeks start on Monday and week 1 holds the first Thursday)
- Gregorian calendar leap-year rule: every 4th year, except centuries not divisible by 400
Try the calculator
Keep reading
This guide is general information, not legal, financial or religious advice. Figures are estimates worked out from the sources above and may differ from what applies to you. See the disclaimer. Found a mistake? Tell us.