Date Calculator
Count the days between two dates, add or subtract days, weeks, months and years, find a date a number of business days away, or work out an exact age on any date. Free, exact, with every step shown.
🧮 1. Date Calculator
Inputs
Working days settings: weekend and holidays
Your Result
___
Full breakdown, charts and exports are in Section 2 below.
Download your result as a plain text file.
📊 2. Your Results
⚡ Quick Answer
A date calculator finds the number of days between two dates, or the new date after adding or subtracting days, weeks, months or years.
Example: 31 Mar 2027 − 17 Nov 2026 = 134 days = 4 months 14 days
Rule of thumb: 1 year = 365 days (366 in a leap year), 1 week = 7 days, and months are 28 to 31 days, so never assume 30.
Key Takeaways
- A date calculator subtracts two day counts, so 17 Nov 2026 to 31 Mar 2027 is 134 days.
- Counting both the start and end date adds exactly 1 day: 1 Jan to 31 Dec 2026 is 364 days apart but 365 days long.
- A leap year has 366 days: divisible by 4, except century years not divisible by 400, so 2000 was a leap year and 1900 was not.
- Adding 1 month to 31 January gives 28 February (29 in a leap year), not 3 March.
- 2026 has 261 Monday to Friday working days before any public holidays are removed.
📚 3. What Is a Date Calculator?
A date calculator is a tool that does arithmetic with calendar dates. You give it two dates and it tells you how far apart they are. Or you give it one date and an amount of time, and it tells you the date you land on. It does the boring part, counting the real length of every month and every leap year, so you do not have to count squares on a calendar.
Inside, the idea is simple. Every date is turned into a single whole number: a count of days from a fixed starting point. 17 November 2026 becomes day 46,343 on the same scale Excel uses. 31 March 2027 becomes day 46,477. Subtract them and you get 134 days. Because each date is just a number, there is no rounding and no guessing about month lengths.
This calculator does four jobs in one place:
- Days between dates, also called a date duration or date difference calculator. You get total days, years, months and days, weeks, working days, hours, minutes and seconds. Add clock times to make it a date and time duration calculator.
- Add or subtract. Add days, weeks, months or years to a date, or take them away, to find a future date or a past date.
- Business days. Move forward or back by working days only, skipping weekends and the holidays you list, the same way Excel WORKDAY does.
- Age on a specific date. Enter a date of birth and any date to get the exact age in years, months and days.
Because it does all four jobs, this one page works as a days between dates calculator, a date difference calculator, a date to date calculator, a date range calculator, a date add calculator, a future date calculator, a business date calculator, a week calculator from date, a time and date calculator and an age calculator on a specific date. Use it online on a phone or a computer: nothing to install, and every date calculation stays in your browser.
Who uses it: office staff counting notice periods and invoice terms, students counting days to an exam, travellers checking visa stays, project managers planning milestones, HR teams counting leave, parents and doctors working out a child's exact age, and analysts checking spreadsheet formulas.
Date calculator vs counting on a calendar vs a spreadsheet
| Method | Good at | Where it goes wrong |
|---|---|---|
| This date calculator | Exact days, Y/M/D, working days, age, any date from year 1 to 9999 | Needs you to say whether the end date counts |
| Counting on a paper calendar | Short ranges, a week or two | Easy to lose count, miss a leap day, or count both ends by accident |
| Excel or Google Sheets | Many rows at once with =B2-A2, NETWORKDAYS, DATEDIF | Text dates, the 1900 leap-year bug, DATEDIF "MD" errors (Section 8) |
| "30 days per month" shortcut | Quick rough guess | Wrong by up to 2 days per month, and by days over a year |
🧠 4. Interpretation of Your Result
4.1 What your result says
___ Run the calculator above to fill this in.
4.2 Calendar days vs working days in your range
___ Run the calculator above to fill this in.
4.3 Months and leap days inside your range
___ Run the calculator above to fill this in.
4.4 Key dates inside your range
___ Run the calculator above to fill this in.
4.5 "Between" is not the same as "how many days long"
This is the fence-post problem. A fence 10 metres long with a post every metre has 11 posts. Dates work the same way. From Monday to Friday is 4 days apart, but if you work Monday to Friday you work 5 days. Use the "Count the end date?" setting to choose. Hotel nights, interest days and "days until" use the gap (end date not counted). Days of leave, event days and "how many days is the festival" count both ends.
4.6 Why a month is not 30 days
Months have 28, 29, 30 or 31 days. So "1 month" is a calendar idea, not a fixed number of days. From 15 January to 15 February is 1 month and 31 days. From 15 February to 15 March is also 1 month but only 28 days. When this date calculator says "4 months, 14 days", it means four calendar months forward from the start date, then 14 more days. The average month is 30.44 days, which is only useful for rough planning.
4.7 What to do next
- For a deadline, check whether the rule counts calendar days or business days, then re-run in the matching mode.
- For working days, open the settings and add the public holidays for your country and year.
- For a contract or legal period, read how the document defines a day and a month, then compare with the result here.
- For a spreadsheet, copy the matching formula from Section 8 and check that it gives the same number.
4.8 Common mistakes this calculator prevents
- Forgetting that February has 28 or 29 days.
- Missing a leap day, or adding one in 1900 or 2100, which are not leap years.
- Counting both ends when you meant the gap, or the gap when you meant both ends.
- Typing the day and month the wrong way round (11/12 can mean 11 December or 12 November).
- Adding a month to the 31st and getting a date that does not exist.
- Counting weekends as working days, or forgetting a public holiday.
- Daylight saving shifting a time-only calculation by an hour. Dates here are never shifted.
✍ 5. How to Use Your Result
Five ready-to-copy cards, filled in with your own dates after you press Calculate.
___ Run the calculator above to fill this card.___ Run the calculator above to fill this card.___ Run the calculator above to fill this card.___ Run the calculator above to fill this card.___ Run the calculator above to fill this card.∑ 6. Date Calculator Formulas Used
These are the exact rules behind every number on this page. They follow the calendar algorithms published by Dershowitz and Reingold (1990) and Fliegel and Van Flandern (1968).
📝 7. How to Use This Date Calculator
The worked example below counts the days from 17 November 2026 to 31 March 2027.
- Choose a mode. Pick Days Between Dates, Add / Subtract, Business Days or Age on a Date from the four tabs at the top of the calculator.
- Enter the start date. Click the start date box and pick 17 November 2026 from the calendar, or press Today to use today's date.
- Enter the end date. Pick 31 March 2027 as the end date. The end date can be before the start date if you want to count backwards.
- Decide whether the end date counts. Leave "Count the end date?" on No to get the gap, or choose Yes to count both days and add 1.
- Add times if you need hours. Set "Add times of day?" to Yes and enter clock times for a date and time duration in hours and minutes.
- Set the weekend and holidays. Open Working days settings, choose your weekend, and paste public holidays as YYYY-MM-DD dates.
- Press Calculate. Press the Calculate button. Nothing is worked out until you do, so your inputs are never overwritten.
- Read the headline result. The panel on the right shows 134 days and the breakdown 4 months, 14 days. The strip below shows the subtraction 46477 minus 46343.
- Check the full breakdown. Scroll to Section 2 for weeks, working days (97), hours, the month-by-month table and the two charts.
- Save or share the answer. Press Copy Result, Download TXT, Download Doc or Download PDF to keep your result.
📈 8. How to Calculate Dates in Excel
Excel stores every date as a serial number: 1 January 1900 is 1, and 17 November 2026 is 46343. That is why you can subtract one date from another and get days. Every formula below uses the same worked example as the calculator: 17 Nov 2026 to 31 Mar 2027. The same formulas work in Google Sheets, except that Sheets has no Analysis ToolPak to switch on and shows DATEDIF in its function list, while Excel hides it.
8.1 The Excel date functions you need
| Task | Formula | Result for the example |
|---|---|---|
| Days between two dates | =B2-A2 or =DAYS(B2,A2) | 134 |
| Days, counting both dates | =B2-A2+1 | 135 |
| Whole years, months, leftover days | =DATEDIF(A2,B2,"Y"), "YM", "MD" | 0, 4, 14 |
| Total whole months | =DATEDIF(A2,B2,"M") | 4 |
| Working days, Mon to Fri | =NETWORKDAYS(A2,B2) | 97 |
| Working days, custom weekend | =NETWORKDAYS.INTL(A2,B2,7) | Friday and Saturday weekend |
| Add days to a date | =A2+90 | 15-Feb-2027 |
| Add months to a date | =EDATE(A2,4) | 17-Mar-2027 |
| Add business days | =WORKDAY(A2,10,H2:H3) | The 10th working day after A2 |
| Last day of a month | =EOMONTH(A2,0) | 30-Nov-2026 |
| Day of the week | =TEXT(A2,"dddd") | Tuesday |
| ISO week number | =ISOWEEKNUM(A2) | 47 |
| Age from date of birth | =DATEDIF(A5,TODAY(),"Y") | Whole years today |
| Fraction of a year | =YEARFRAC(A2,B2,1) | About 0.37 |
8.2 Step by step
1 Type the two dates and check Excel sees them as dates
Put the start date in A2 and the end date in B2. A real date is right-aligned in the cell. If it sits on the left, Excel has stored it as text and every formula below will fail with #VALUE!. Type dates as 2026-11-17 to avoid any day and month mix-up.
Start date 17-Nov-2026 in A2 and end date 31-Mar-2027 in B2, both right-aligned, so both are real dates.
2 Subtract to get the days between dates
=B2-A2=B2-A2+1Plain subtraction gives the gap, with the end date not counted. Add 1 when both days count. If Excel shows a date like 13-May-1900 instead of 134, change the cell format to General or Number.
C2 returns 134 days and D2 returns 135 when both dates are counted. Same answer as the calculator above.
3 Split it into years, months and days with DATEDIF
=DATEDIF(A2,B2,"Y")&" y "&DATEDIF(A2,B2,"YM")&" m "&DATEDIF(A2,B2,"MD")&" d"DATEDIF is a hidden function: Excel does not show it in the formula list, but it works. "Y" gives whole years, "YM" the months left after the years, and "MD" the days left after the months.
The text in E2 reads 0 y 4 m 14 d, which matches the calculator's 4 months, 14 days.
4 Count working days with NETWORKDAYS
=NETWORKDAYS(A2,B2)=NETWORKDAYS(A2,B2,H2:H3)NETWORKDAYS counts Monday to Friday and includes both the start and the end date. Put your holidays in a range such as H2:H3 and add it as the third argument. For a different weekend use NETWORKDAYS.INTL with a weekend code from Table 11.6.
97 working days, or 95 once 25 Dec 2026 and 1 Jan 2027 are listed in H2:H3.
5 Add days, months and business days to a date
=A2+90=EDATE(DATE(2026,1,31),1)=WORKDAY(DATE(2026,12,22),10,H2:H3)Adding a number adds days. EDATE adds whole months and clamps to the last day of a short month. WORKDAY moves by working days and does not count the start date.
Results: 15-Feb-2027, 28-Feb-2026 and 07-Jan-2027, the same three dates the calculator gives for these samples.
6 How to calculate age from date of birth in Excel
=DATEDIF(A5,B5,"Y")=DATEDIF(A5,TODAY(),"Y")This is the most searched date formula. Put the date of birth in A5. Use a fixed date in B5 for age on a specific date, or TODAY() for age now. Add "YM" and "MD" for the months and days.
Born 15-Aug-1990, the age on 17-Nov-2026 is 36 years, 3 months, 2 days, exactly what the Age tab shows.
=INT(YEARFRAC(A5,B5,1)) also gives whole years and is easier to remember, but it works with fractions of a year, so it can round to the wrong whole year right around a birthday. DATEDIF with "Y" counts completed years and does not have that problem.8.3 The awkward cases in Excel
- Date and time duration. Put date and time together:
=(B2+TIME(17,45,0))-(A2+TIME(9,30,0))gives 3.34375 days. Multiply by 24 for 80.25 hours, or format the cell as[h]:mmto show 80:15. - End date before start date.
=B2-A2gives a negative number, which is fine.DATEDIFreturns#NUM!. Wrap it:=DATEDIF(MIN(A2,B2),MAX(A2,B2),"D"). - Weeks between two dates.
=INT((B2-A2)/7)for whole weeks and=MOD(B2-A2,7)for the days left over. - Year to date. Days from 1 January to a date:
=A2-DATE(YEAR(A2),1,1)+1, which gives 321 for 17 Nov 2026.
DATEDIF with "MD" can give a negative number, a zero or a wrong result, mostly when the start day is late in a month (29th to 31st). When the start day is the 29th, 30th or 31st, check "MD" against this calculator.8.4 Why your Excel answer might differ from this calculator, R or Python
| Situation | What happens | Fix |
|---|---|---|
| Dates before 1 March 1900 | Excel wrongly treats 1900 as a leap year (it shows 29-Feb-1900), so any range crossing February 1900 is 1 day too long. 1 Jan 1900 to 1 Jan 2000 gives 36,525 in Excel; the true answer is 36,524 | Trust this calculator, R or Python for dates before March 1900 |
| Dates before 1900 | Excel cannot store them at all; they stay as text | Use R, Python or this calculator |
| DATEDIF "MD" near month ends | Can be off by a day or negative | Use the leftover-days method in Section 6, card 4 |
| Counting both dates | =B2-A2 excludes the end date but NETWORKDAYS includes both | Be clear which one your rule wants; this page labels each |
| The 1904 date system (older Mac files) | Every serial number is 1,462 lower, so copied dates jump 4 years | File, Options, Advanced: untick "Use 1904 date system", or keep both files on the same system |
| Times and daylight saving | Excel ignores time zones; Python and R may not if you give them one | Use plain local times everywhere, as this page does |
8.5 Charting a date range in Excel
For a quick timeline, list your milestone dates in column A and a label in column B, then Insert, Charts, Bar, and format the horizontal axis as a date axis. For a Gantt-style chart, use a stacked bar: first series is the start date (set its fill to none), second series is the duration in days from =B2-A2. To chart days per month like Chart 2 above, build a list of month starts with =EDATE(start,ROW()-2) and count with =MIN(EOMONTH(C2,0),end)-MAX(C2,start)+1.
8.6 Excel error messages and what they mean
| Error | Cause | Fix |
|---|---|---|
#VALUE! | One of the "dates" is text, often from a CSV or a copied web page | Use =DATEVALUE(A2), or Data, Text to Columns, choose the date order |
#NUM! | DATEDIF start date is later than the end date | Swap the dates or use MIN and MAX |
##### | The column is too narrow, or a date formula returned a negative number | Widen the column, or format the cell as General |
#NAME? | A function name is misspelt, or the file is very old and lacks NETWORKDAYS.INTL | Check the spelling; use Excel 2010 or newer |
| A date instead of a number | Excel copied the date format into the result cell | Home, Number Format, General |
📈 9. How to Calculate Dates in R
Base R handles dates with the Date class, which stores each date as a count of days since 1 January 1970. That makes subtraction exact. The script below needs no extra packages and gives the same numbers as the calculator and the Excel section.
9.1 The complete script
R, base only, saves date_calculator_plot.png
# ============================================================
# Date calculator in base R: days between dates, years/months/days,
# working days, add days or months, business days, age, and a plot
# StatsUnlock - https://statsunlock.com/date-calculator/
# ============================================================
# ---- 1. Your dates (change these lines only) ----
start <- as.Date("2026-11-17")
end <- as.Date("2027-03-31")
holidays <- as.Date(c("2026-12-25", "2027-01-01")) # use as.Date(character(0)) for none
dob <- as.Date("1990-08-15")
# To read many pairs from a file instead:
# df <- read.csv("dates.csv"); df$start <- as.Date(df$start); df$end <- as.Date(df$end)
# df <- df[!is.na(df$start) & !is.na(df$end), ] # drop rows with missing dates
# ---- 2. Helper functions ----
days_in_month <- function(y, m) {
nxt <- as.Date(sprintf("%04d-%02d-01", y + (m == 12), m %% 12 + 1))
as.integer(format(nxt - 1, "%d"))
}
add_months <- function(d, k) { # month-end clamp, like Excel EDATE
y <- as.integer(format(d, "%Y")); m <- as.integer(format(d, "%m"))
dd <- as.integer(format(d, "%d"))
t <- y * 12 + (m - 1) + k
y2 <- t %/% 12; m2 <- t %% 12 + 1
as.Date(sprintf("%04d-%02d-%02d", y2, m2, min(dd, days_in_month(y2, m2))))
}
ymd_diff <- function(a, b) { # a <= b; same rule as the web calculator
n <- (as.integer(format(b, "%Y")) - as.integer(format(a, "%Y"))) * 12 +
(as.integer(format(b, "%m")) - as.integer(format(a, "%m")))
if (add_months(a, n) > b) n <- n - 1
c(years = n %/% 12, months = n %% 12, days = as.numeric(b - add_months(a, n)))
}
is_workday <- function(d, hol) !(format(d, "%u") %in% c("6", "7")) & !(d %in% hol)
add_workdays <- function(d, n, hol) { # same rule as Excel WORKDAY
step <- if (n < 0) -1 else 1; left <- abs(n)
while (left > 0) { d <- d + step; if (is_workday(d, hol)) left <- left - 1 }
d
}
# ---- 3. Days between dates ----
days <- as.numeric(end - start) # end date not counted
inclusive <- days + 1 # both dates counted
ymd <- ymd_diff(start, end)
span <- seq(start, end, by = "day")
workdays <- sum(is_workday(span, as.Date(character(0)))) # like NETWORKDAYS(A2,B2)
workdays_h <- sum(is_workday(span, holidays)) # like NETWORKDAYS(A2,B2,holidays)
cat("Days between:", days, "| inclusive:", inclusive, "\n")
cat("Y/M/D:", ymd["years"], "years,", ymd["months"], "months,", ymd["days"], "days\n")
cat("Weeks:", days %/% 7, "weeks +", days %% 7, "day(s)\n")
cat("Working days, Mon-Fri:", workdays, "| minus 2 holidays:", workdays_h, "\n")
# ---- 4. Add and subtract ----
cat("Start + 90 days:", format(start + 90, "%A %d %B %Y"), "\n")
cat("31 Jan 2026 + 1 month:", format(add_months(as.Date("2026-01-31"), 1)), "\n")
cat("10 business days after 22 Dec 2026:",
format(add_workdays(as.Date("2026-12-22"), 10, holidays)), "\n")
# ---- 5. Age on a specific date ----
age <- ymd_diff(dob, start)
cat("Age on", format(start), ":", age["years"], "y", age["months"], "m", age["days"], "d\n")
# ---- 6. Date and time duration ----
t1 <- as.POSIXct("2026-11-17 09:30", tz = "UTC")
t2 <- as.POSIXct("2026-11-20 17:45", tz = "UTC")
cat("Duration:", as.numeric(difftime(t2, t1, units = "hours")), "hours\n")
# ---- 7. Plain-English verdict ----
cat(sprintf("Verdict: %s to %s is %d days (%d months %d days), with %d working days.\n",
format(start, "%d %b %Y"), format(end, "%d %b %Y"), days,
ymd["years"] * 12 + ymd["months"], ymd["days"], workdays))
# ---- 8. One 300 dpi figure: days per month in the range ----
mon <- factor(format(span, "%b %Y"), levels = unique(format(span, "%b %Y")))
counts <- table(mon)
png("date_calculator_plot.png", width = 2400, height = 1500, res = 300)
par(mar = c(5, 4.5, 3, 1))
bp <- barplot(counts, col = "#22c55e", border = NA, las = 2, ylim = c(0, 35),
ylab = "Days in range", main = "Days in each month of the range")
text(bp, counts, labels = counts, pos = 3, cex = 0.8)
dev.off()
cat("Saved date_calculator_plot.png\n")
Output when run: Days between: 134 | inclusive: 135, Y/M/D: 0 years, 4 months, 14 days, Working days, Mon-Fri: 97 | minus 2 holidays: 95, Start + 90 days: Monday 15 February 2027, Age ... 36 y 3 m 2 d, Duration: 80.25 hours.
9.2 What each line does
| Line or function | What it does, and why it is there |
|---|---|
| as.Date("2026-11-17") | Turns text into a real date. Always use the YYYY-MM-DD form so there is no day and month mix-up. |
| end - start | Subtracting two dates gives a difftime in days. as.numeric() turns it into a plain number. |
| add_months() | Adds whole months and clamps to the last day of a short month, the same rule as Excel EDATE. |
| ymd_diff() | Finds the largest number of whole months, then the leftover days. This is the same rule the calculator uses. |
| format(d, "%u") | Day of the week as 1 (Monday) to 7 (Sunday). Unlike weekdays(), it does not change with your computer's language. |
| seq(start, end, by = "day") | Lists every date in the range, both ends included, so sum(is_workday(...)) matches NETWORKDAYS. |
| add_workdays() | Steps one day at a time and counts only working days, the same as Excel WORKDAY. |
| difftime(t2, t1, units = "hours") | Date and time duration. Setting tz = "UTC" stops daylight saving from adding or removing an hour. |
| png(..., res = 300) | Saves the chart at 300 dots per inch, ready for a report. |
9.3 What the figure shows
The bar chart has one bar per calendar month in the range. For the example, November 2026 has 14 days in range (17 to 30 November), then 31, 31, 28 and 31. The bars add up to 135, the inclusive total. It is the same picture as Chart 2 in Section 2.
9.4 Common problems and fixes
| Problem | Fix |
|---|---|
character string is not in a standard unambiguous format | Give the format: as.Date("17/11/2026", format = "%d/%m/%Y") |
| Answer prints as "Time difference of 134 days" | Wrap it: as.numeric(end - start) |
| Weekday names come out in another language | Use format(d, "%u") numbers, as the script does |
| Hours off by one around March or October | Use tz = "UTC" in as.POSIXct() |
| Want lubridate instead | library(lubridate); interval(start, end) %/% months(1) gives whole months; start %m+% months(1) adds a month with the clamp |
9.5 Handy one-liners
- Day of the week:
format(as.Date("2026-11-17"), "%A")gives "Tuesday". - Day of the year:
as.integer(format(as.Date("2026-11-17"), "%j"))gives 321. - Is it a leap year:
y %% 4 == 0 & (y %% 100 != 0 | y %% 400 == 0). - Last day of a month:
seq(as.Date("2026-02-01"), by = "month", length.out = 2)[2] - 1.
📈 10. How to Calculate Dates in Python
Python's built-in datetime module subtracts dates exactly. dateutil.relativedelta gives years, months and days with the same month-end rule as this calculator, and numpy.busday_count counts working days.
Install once with pip install python-dateutil numpy matplotlib.
10.1 The complete script
Python 3, saves date_calculator_plot.png
# ============================================================
# Date calculator in Python: days between dates, years/months/days,
# working days, add days or months, business days, age, and a plot
# StatsUnlock - https://statsunlock.com/date-calculator/
# pip install python-dateutil numpy matplotlib
# ============================================================
from datetime import date, datetime, timedelta
from collections import Counter
from dateutil.relativedelta import relativedelta
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# ---- 1. Your dates (change these lines only) ----
start = date(2026, 11, 17)
end = date(2027, 3, 31)
holidays = ["2026-12-25", "2027-01-01"] # use [] for none
dob = date(1990, 8, 15)
# To read many pairs from a file instead:
# import pandas as pd
# df = pd.read_csv("dates.csv", parse_dates=["start", "end"]).dropna(subset=["start", "end"])
# df["days"] = (df["end"] - df["start"]).dt.days
# ---- 2. Days between dates ----
days = (end - start).days # end date not counted
inclusive = days + 1 # both dates counted
ymd = relativedelta(end, start) # same rule as the web calculator
next_day = (end + timedelta(days=1)).isoformat() # busday_count excludes its end, so add 1
workdays = int(np.busday_count(start.isoformat(), next_day)) # NETWORKDAYS(A2,B2)
workdays_h = int(np.busday_count(start.isoformat(), next_day, holidays=holidays))
print(f"Days between: {days} | inclusive: {inclusive}")
print(f"Y/M/D: {ymd.years} years, {ymd.months} months, {ymd.days} days")
print(f"Weeks: {days // 7} weeks + {days % 7} day(s)")
print(f"Working days, Mon-Fri: {workdays} | minus 2 holidays: {workdays_h}")
# ---- 3. Add and subtract ----
print("Start + 90 days:", (start + timedelta(days=90)).strftime("%A %d %B %Y"))
print("31 Jan 2026 + 1 month:", date(2026, 1, 31) + relativedelta(months=1))
print("10 business days after 22 Dec 2026:",
np.busday_offset("2026-12-22", 10, roll="forward", holidays=holidays))
# ---- 4. Age on a specific date ----
age = relativedelta(start, dob)
print(f"Age on {start}: {age.years} y {age.months} m {age.days} d")
# ---- 5. Date and time duration ----
t1 = datetime(2026, 11, 17, 9, 30)
t2 = datetime(2026, 11, 20, 17, 45)
print("Duration:", (t2 - t1).total_seconds() / 3600, "hours")
# ---- 6. Plain-English verdict ----
months = ymd.years * 12 + ymd.months
print(f"Verdict: {start:%d %b %Y} to {end:%d %b %Y} is {days} days "
f"({months} months {ymd.days} days), with {workdays} working days.")
# ---- 7. One 300 dpi figure: days per month in the range ----
span = [start + timedelta(days=i) for i in range(inclusive)]
counts = Counter(d.strftime("%b %Y") for d in span)
labels = list(dict.fromkeys(d.strftime("%b %Y") for d in span))
values = [counts[k] for k in labels]
fig, ax = plt.subplots(figsize=(8, 5))
bars = ax.bar(labels, values, color="#22c55e")
ax.bar_label(bars, fontsize=9)
ax.set_ylabel("Days in range")
ax.set_ylim(0, 35)
ax.set_title("Days in each month of the range")
fig.tight_layout()
fig.savefig("date_calculator_plot.png", dpi=300)
print("Saved date_calculator_plot.png")
Output when run: Days between: 134 | inclusive: 135, Y/M/D: 0 years, 4 months, 14 days, Working days, Mon-Fri: 97 | minus 2 holidays: 95, 10 business days after 22 Dec 2026: 2027-01-07, Duration: 80.25 hours. Identical to R and Excel.
10.2 What each line does
| Line or function | What it does, and why it is there |
|---|---|
| date(2026, 11, 17) | Builds a date from numbers, so there is never a day and month mix-up. |
| (end - start).days | Subtracting dates gives a timedelta; .days is the gap with the end date not counted. |
| relativedelta(end, start) | Years, months and days with the month-end clamp. Checked to match the calculator on 4,000 random date pairs. |
| np.busday_count(a, b) | Counts Monday to Friday from a up to, but not including, b. That is why the script adds one day to the end date to match NETWORKDAYS. |
| np.busday_offset(..., roll="forward") | Moves by working days, the same as Excel WORKDAY. Use weekmask="1111001" for a Friday and Saturday weekend. |
| start + relativedelta(months=1) | Adds a calendar month. Plain timedelta has no months, because months have different lengths. |
| (t2 - t1).total_seconds() / 3600 | Date and time duration in hours. Naive datetimes (no time zone) ignore daylight saving, like this page. |
| fig.savefig(..., dpi=300) | Saves the chart at print quality. |
10.3 What the figure shows
One bar per month of the range: 14, 31, 31, 28 and 31 days for November 2026 to March 2027. The bars add up to 135, the inclusive day count, and match Chart 2 above and the R figure.
10.4 Common problems and fixes
| Problem | Fix |
|---|---|
TypeError: unsupported operand type(s) | You mixed a date and a datetime. Convert one: dt.date() |
ModuleNotFoundError: No module named 'dateutil' | pip install python-dateutil (the import name is dateutil) |
| Working days one lower than Excel | busday_count excludes the end date; add one day to it, as the script does |
| Text dates from a CSV | datetime.strptime("17/11/2026", "%d/%m/%Y").date(), or parse_dates in pandas |
| pandas months look wrong | pd.DateOffset(months=1) clamps like this page; avoid Timedelta for months |
10.5 Handy one-liners
- Day of the week:
date(2026, 11, 17).strftime("%A")gives "Tuesday". - ISO week:
date(2026, 11, 17).isocalendar()[1]gives 47. - Leap year:
import calendar; calendar.isleap(2028)gives True. - Days in a month:
calendar.monthrange(2026, 2)[1]gives 28.
📋 11. Date Calculator Reference Tables
Lookup tables for the questions people search most. Every value was generated by the same engine as the calculator.
11.1 Days in each month and day of the year at month end
| Month | Days (common year) | Days (leap year) | Day of year at month end (common) | Day of year at month end (leap) |
|---|---|---|---|---|
| January | 31 | 31 | 31 | 31 |
| February | 28 | 29 | 59 | 60 |
| March | 31 | 31 | 90 | 91 |
| April | 30 | 30 | 120 | 121 |
| May | 31 | 31 | 151 | 152 |
| June | 30 | 30 | 181 | 182 |
| July | 31 | 31 | 212 | 213 |
| August | 31 | 31 | 243 | 244 |
| September | 30 | 30 | 273 | 274 |
| October | 31 | 31 | 304 | 305 |
| November | 30 | 30 | 334 | 335 |
| December | 31 | 31 | 365 | 366 |
What to conclude: Only February changes in a leap year, so every date from 1 March onward has a day-of-year number one higher in a leap year.
11.2 Time unit conversions used by the date calculator
| Unit | Days | Hours | Note |
|---|---|---|---|
| 1 day | 1 | 24 | 1,440 minutes, 86,400 seconds |
| 1 week | 7 | 168 | |
| 1 fortnight | 14 | 336 | |
| 1 month (average) | 30.436875 | 730.485 | Real months are 28 to 31 days |
| 1 quarter (average) | 91.310625 | 2,191.455 | Real quarters are 90 to 92 days |
| 1 common year | 365 | 8,760 | 52 weeks + 1 day |
| 1 leap year | 366 | 8,784 | 52 weeks + 2 days |
| 1 average Gregorian year | 365.2425 | 8,765.82 | Used for decimal years |
| 400-year cycle | 146,097 | 3,506,328 | Exactly 20,871 weeks |
What to conclude: Use average months only for rough planning. For exact dates, the calculator always uses the real month lengths.
11.3 Leap years from 2000 to 2060
| Leap years | Count |
|---|---|
| 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028 | 8 |
| 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060 | 8 |
What to conclude: 2000 was a leap year because it divides by 400. 1900 was not, and 2100 will not be. The next 29 February after 2026 is in 2028.
11.4 Working days per month in 2026 and 2027 (Monday to Friday)
| Month | 2026 | 2027 |
|---|---|---|
| January | 22 | 21 |
| February | 20 | 20 |
| March | 22 | 23 |
| April | 22 | 22 |
| May | 21 | 21 |
| June | 22 | 22 |
| July | 23 | 22 |
| August | 21 | 22 |
| September | 22 | 22 |
| October | 22 | 21 |
| November | 21 | 22 |
| December | 23 | 23 |
| Whole year | 261 | 261 |
What to conclude: These counts exclude only Saturdays and Sundays. Subtract the public holidays that fall on weekdays where you work.
11.5 What date is N days after 1 January 2027?
| Add | Result date |
|---|---|
| 7 days | Friday, 8 January 2027 |
| 14 days | Friday, 15 January 2027 |
| 30 days | Sunday, 31 January 2027 |
| 45 days | Monday, 15 February 2027 |
| 60 days | Tuesday, 2 March 2027 |
| 90 days | Thursday, 1 April 2027 |
| 100 days | Sunday, 11 April 2027 |
| 120 days | Saturday, 1 May 2027 |
| 180 days | Wednesday, 30 June 2027 |
| 270 days | Tuesday, 28 September 2027 |
| 365 days | Saturday, 1 January 2028 |
What to conclude: Day counts like 30, 60 and 90 are the usual payment terms and notice periods. Use the Add tab for any other start date.
11.6 Excel NETWORKDAYS.INTL and WORKDAY.INTL weekend codes
| Code | Weekend days | Code | Weekend day |
|---|---|---|---|
| 1 | Saturday, Sunday | 11 | Sunday only |
| 2 | Sunday, Monday | 12 | Monday only |
| 3 | Monday, Tuesday | 13 | Tuesday only |
| 4 | Tuesday, Wednesday | 14 | Wednesday only |
| 5 | Wednesday, Thursday | 15 | Thursday only |
| 6 | Thursday, Friday | 16 | Friday only |
| 7 | Friday, Saturday | 17 | Saturday only |
What to conclude: Code 1 is the default. Code 7 matches this calculator's Friday and Saturday option, and code 11 matches Sunday only.
11.7 Days in each quarter and half year
| Year | Q1 | Q2 | Q3 | Q4 | H1 | Full year |
|---|---|---|---|---|---|---|
| 2026 | 90 | 91 | 92 | 92 | 181 | 365 |
| 2027 | 90 | 91 | 92 | 92 | 181 | 365 |
| 2028 | 91 | 91 | 92 | 92 | 182 | 366 |
What to conclude: Quarter 1 is the shortest at 90 days (91 in a leap year such as 2028). Quarters 3 and 4 are always 92 days.
📈 12. Example Results
Eight worked examples. Each one can be reproduced with the example list at the top of the calculator.
A whole calendar year
The cleanest check that any date calculator is working.
You want to know how many days, weeks and working days are in 2026, from 1 January to 31 December.
| Measure | Value | Note |
|---|---|---|
| Start | Thursday, 1 January 2026 | Thursday |
| End | Thursday, 31 December 2026 | Thursday |
| Days apart (end not counted) | 364 | =B2-A2 in Excel |
| Days long (both counted) | 365 | Common year |
| Working days, Mon to Fri | 261 | Before public holidays |
| Weekend days | 104 | 52 Saturdays + 52 Sundays |
| Weeks | 52 weeks, 1 day | 365 = 52 x 7 + 1 |
What it means: The two answers, 364 and 365, differ only by whether the last day counts. A year from 1 Jan is 365 days long, but 31 Dec is only 364 days after 1 Jan.
How to use it: Use 365 for "how many days are in 2026". Use 261 as the starting point for annual leave or working-day budgets, then subtract your public holidays.
A whole century: 1900 to 2000
Large spans and the 1900 leap-year trap.
A historian wants the exact number of days from 1 January 1900 to 1 January 2000.
| Measure | Value | Note |
|---|---|---|
| Days between | 36,524 | End date not counted |
| Years, months, days | 100 years, 0 months, 0 days | Exact |
| Leap days inside | 24 | 1904 to 1996; 1900 is not a leap year |
| Weeks | 5,217 weeks, 5 days | |
| Excel =B2-A2 | 36,525 | One too many: Excel counts a fake 29 Feb 1900 |
What it means: A century is not 36,525 days. 1900 had no 29 February, so this span is 36,524 days. Excel gets this wrong by one day because it keeps a fake 29 Feb 1900 for compatibility with very old software.
How to use it: For any range that starts before March 1900, trust this calculator, R or Python, not Excel.
Date and time duration in hours
A short span measured to the minute.
A job started on 17 Nov 2026 at 09:30 and finished on 20 Nov 2026 at 17:45. How long did it take?
| Measure | Value | Note |
|---|---|---|
| Start | Tue 17 Nov 2026, 09:30 | |
| End | Fri 20 Nov 2026, 17:45 | |
| Whole days | 3 | 3 x 1440 = 4,320 minutes |
| Clock difference | 8 h 15 m | 17:45 - 09:30 = 495 minutes |
| Total minutes | 4,815 | 4,320 + 495 |
| Total hours | 80.25 | 4,815 / 60 |
What it means: The elapsed time is 80.25 hours. That is calendar time, not working time: it includes the nights.
How to use it: Use the hours for a service clock or a hire charge. For paid working hours, use a timesheet instead, because nights and breaks are not work.
A leap-day birthday
The day where two common rules disagree.
Someone was born on 29 February 2000. How old are they on 28 February 2026, a common year with no 29 February?
| Measure | Value | Note |
|---|---|---|
| Born | Tue 29 Feb 2000 | Leap day |
| Age on | Sat 28 Feb 2026 | Common year |
| Age here | 26 years, 0 months, 0 days | 28 Feb treated as the birthday |
| Age under 1 March rule | 25 years | Turns 26 on 1 Mar 2026 |
| Days lived | 9,496 | Same under both rules |
What it means: This is a genuine borderline case. This calculator uses 28 February, the same as Python relativedelta. Some legal systems, such as the UK, use 1 March.
How to use it: If an age limit matters legally on this exact day, check which rule your country uses. One day later, both rules agree.
Adding 1 month to 31 January
Why "one month later" is not always the same day number.
A subscription starts on 31 January 2026. When is "one month later", and two months later?
| Measure | Value | Note |
|---|---|---|
| Start | Sat 31 Jan 2026 | |
| + 1 month | Sat 28 Feb 2026 | Clamped: February has no 31st |
| + 2 months | Tue 31 Mar 2026 | March has a 31st again |
| + 30 days instead | Mon 2 Mar 2026 | A fixed day count gives a different date |
| Excel | =EDATE(DATE(2026,1,31),1) | Also gives 28-Feb-2026 |
What it means: The tempting answer, 3 March, is wrong: it treats the missing days as overflow. Calendars, banks and Excel all clamp to the last day of the short month instead.
How to use it: If your contract says "30 days", add 30 days. If it says "1 month", add 1 month. They are different dates.
10 business days over the holidays
A shipping or payment promise in late December.
An order is placed on Tuesday 22 December 2026 with delivery "within 10 business days". Christmas Day and New Year's Day are holidays.
| Measure | Value | Note |
|---|---|---|
| Start | Tue 22 Dec 2026 | Not counted |
| Business days | 10 | Mon to Fri |
| Holidays skipped | 25 Dec, 1 Jan | Both Fridays |
| Weekend days skipped | 4 | 26, 27 Dec and 2, 3 Jan |
| Result | Thu 7 Jan 2027 | Same as Excel WORKDAY |
| Without holidays | Tue 5 Jan 2027 | Two days earlier |
What it means: Business-day promises stretch a lot around holidays. Ignoring the two holidays would give 5 January, which is two days too early.
How to use it: Always enter the public holidays of the place where the work happens, then quote the date, not just "10 business days".
Dates entered backwards, and a date that does not exist
What the calculator does with bad input.
Someone types 31 Dec 2026 as the start and 1 Jan 2026 as the end. Another person types 31 April 2027.
| Measure | Value | Note |
|---|---|---|
| Start | Thu 31 Dec 2026 | |
| End | Thu 1 Jan 2026 | Earlier than the start |
| Result | -364 days | Minus sign means backwards |
| Y/M/D of the gap | 11 months, 30 days | Measured from the earlier date |
| 31 April 2027 | Error message | April has 30 days |
What it means: A minus sign is not an error. It tells you the end date comes first. A date like 31 April cannot be picked in the calendar and is rejected if typed.
How to use it: Swap the dates if the order was a mistake. Keep the minus sign if you meant "how many days ago".
Exact age on a specific date
The age calculator use case.
A form asks for exact age on 17 November 2026 for someone born on 15 August 1990.
| Measure | Value | Note |
|---|---|---|
| Born | Wed 15 Aug 1990 | |
| Age on | Tue 17 Nov 2026 | |
| Exact age | 36 years, 3 months, 2 days | Same as Excel DATEDIF |
| Age in months | 435 months, 2 days | |
| Age in days | 13,243 | |
| Next birthday | Sun 15 Aug 2027 | In 271 days, turning 37 |
What it means: Age counts completed years, so this person is 36 until 15 August 2027, even though they are closer to 36.3 years.
How to use it: Use years for forms, years and months for children, and days for medical or growth charts that ask for age in days.
🧪 13. How to Get Your Dates Right
Most wrong date answers come from a wrong input, not a wrong formula. Work through these steps before you trust a deadline.
- Find the official start date. For a contract, it is the date written in it, not the day you signed. For an invoice, it is the invoice date unless the terms say "from receipt".
- Read the date the right way round. 03/04/2027 is 3 April in India and the UK but 4 March in the USA. When in doubt, write the month as a word.
- Decide whether the first day counts. "Within 30 days of" usually starts counting the day after. "From 1 May to 10 May" usually counts both ends.
- Decide whether the last day counts. Then set "Count the end date?" to match.
- Choose calendar days or business days. Shipping, banking and court rules often say "business days". Visas, leases and warranties usually say calendar days.
- Set the right weekend. Saturday and Sunday in most countries. Some countries and many shops use Friday and Saturday, or Sunday only.
- List the public holidays for the right year and place. Take them from your government or employer's official list, in YYYY-MM-DD form.
- Add times only when they matter. Use them for shifts, flights and service clocks. Use the same time zone for both times.
- For age, use the full date of birth. A birth year alone can be off by almost a whole year.
- Re-check after any change. A moved start date or a new holiday changes every result after it.
| Input | Format | Valid range | Typical example |
|---|---|---|---|
| Start date, end date | Calendar picker or YYYY-MM-DD | Year 1 to 9999 | 2026-11-17 |
| Times | 24-hour HH:MM | 00:00 to 23:59 | 09:30 |
| Years, months, weeks, days to add | Whole numbers | 0 up to millions of days | 90 days |
| Business days | Whole number | 0 to 100,000 | 10 |
| Holidays | YYYY-MM-DD list | Any number | 2026-12-25, 2027-01-01 |
| Date of birth and as-of date | Calendar picker | As-of date on or after birth | 1990-08-15 and 2026-11-17 |
Common input mistakes
- Typing 2026 for a date that was really in 2025, especially in January.
- Using the date a parcel was shipped when the rule counts from delivery.
- Leaving last year's holiday list in place for a new year.
- Mixing a time in one time zone with a time in another.
🎯 14. When to Use This Date Calculator
- Count days between two dates, or weeks between two dates
- Find a future date or past date from a number of days, weeks or months
- Count working days or add business days
- Work out an exact age on a specific date
- Measure a date and time duration in hours and minutes
- Check a spreadsheet date formula
- A court, tax or immigration rule defines its own way of counting days
- You need a pregnancy due date (use a due date calculator, which adds 280 days to the last period)
- Times are in different time zones
- You need dates in a non-Gregorian calendar, such as Hijri or Hebrew
- The answer must allow for daylight saving to the exact hour
Four everyday examples
- Notice period: resign on 17 Nov 2026 with 1 month's notice: Add tab, 1 month, last day 17 Dec 2026.
- Net 30 invoice: invoice dated 17 Nov 2026: Add tab, 30 days, due 17 Dec 2026.
- Visa stay: arrive 1 Dec 2026, leave 28 Feb 2027, count both days: Days Between tab, 90 days.
- School age cut-off: born 15 Aug 2021, age on 1 Jun 2027: Age tab, 5 years, 9 months, 17 days.
Which tool should you use?
| Your question | Use |
|---|---|
| How many days between two dates? | Days Between Dates tab |
| What date is 90 days from a date? | Add / Subtract tab, or the StatsUnlock 90 Days From Today page |
| What date is 10 working days from a date? | Business Days tab |
| How old is someone on a date? | Age on a Date tab, or the StatsUnlock Age Calculator |
| How many weeks are in a year? | The StatsUnlock How Many Weeks in a Year page |
| When is a baby due? | A pregnancy due date calculator, not this tool |
Common date calculator searches and where this page answers them
People type the same question in many ways. Find yours in the left column, then use the tab or section shown.
| What people search for | Where to find it | Worked example |
|---|---|---|
| calculate number of days between two dates | Days Between Dates | 17 Nov 2026 to 31 Mar 2027 = 134 days |
| calculate the number of days between 2 dates, counting both | Days Between Dates, "Count the end date?" = Yes | 135 days |
| calculate no of days between 2 dates in Excel | Section 8, step 2 | =B2-A2 returns 134 |
| calculate how many days between dates are working days | Days Between Dates, Working days line | 97 working days |
| calculate the amount of days between two dates in weeks | Days Between Dates, Weeks line | 19 weeks, 1 day |
| calculate weeks between 2 dates | Days Between Dates, Weeks line | 134 / 7 = 19 weeks, 1 day |
| calculate duration between two dates in months | Days Between Dates, Y/M/D line | 4 months, 14 days |
| calculate duration between dates and times (date and time duration calculator) | Days Between Dates, "Add times of day?" = Yes | 80.25 hours |
| date and time calculator: add hours to a date | Add / Subtract, "Include a time of day?" = Yes | 17 Nov 08:00 + 36 h = 18 Nov 20:00 |
| date time calculator in minutes and seconds | Results table, Total minutes and seconds | 134 days = 192,960 minutes |
| date calculator add days / date plus days calculator | Add / Subtract, Days | 17 Nov 2026 + 90 days = 15 Feb 2027 |
| add date calculator for months or years | Add / Subtract, Months or Years | 31 Jan 2026 + 1 month = 28 Feb 2026 |
| date addition calculator for weeks | Add / Subtract, Weeks | 1 Mar 2027 minus 6 weeks = 18 Jan 2027 |
| find future date calculator | Add / Subtract, Add | 1 Jan 2027 + 180 days = 30 Jun 2027 |
| days from date calculator / calculate days from date | Add / Subtract, Days | Invoice 17 Nov 2026 + 30 days = 17 Dec 2026 |
| days to date calculator (days until a date) | Days Between Dates, Start = Today | Days left until your end date |
| business date calculator | Business Days | 10 business days after 22 Dec 2026 = 7 Jan 2027 |
| age calculator on specific date / age date calculator | Age on a Date | Born 15 Aug 1990, on 17 Nov 2026: 36 y 3 m 2 d |
| calculate age based on date of birth | Age on a Date, press Today | Exact years, months and days today |
| how to calculate age in Excel using date of birth | Section 8, step 6 | =DATEDIF(A5,TODAY(),"Y") |
| year to date calculator | Days Between Dates, 1 Jan to your date, both counted | 1 Jan to 17 Nov 2026 = 321 days |
| calendar date calculator / date and calendar calculator | Add / Subtract with 0 days | 17 Nov 2026 is a Tuesday in ISO week 47 |
| date range calculator / date count calculator | Days Between Dates, both counted | Leave from 21 Dec to 2 Jan = 13 days |
| two dates calculator / date calculator two dates / date calculator between 2 dates | Days Between Dates, dates in any order | Reversed dates show a minus sign |
| date calculator between two dates / day date calculator | Days Between Dates | Days, weekdays of both dates, Y/M/D |
| date duration calculator / date calculator duration / date and duration calculator | Days Between Dates | Total days, weeks, months, hours |
| date duration calculator days between dates / duration calculator between two dates | Days Between Dates | 1 Jan 1900 to 1 Jan 2000 = 36,524 days |
| date calculator days / calculator days between dates / day between dates calculator | Days Between Dates | 1 Jan to 31 Dec 2026 = 364 days |
| calculating days between dates / calculate dates between two dates | Section 6, card 1 | Day number of end minus day number of start |
| time calculator between dates / time between dates calculator | Days Between Dates, Total hours | 134 days = 3,216 hours |
| calculate days between two dates online / days calculator between dates online | This page, on any phone or computer | No sign-up, nothing to install |
| date calculator online / online date calculator / calculator for number of days between two dates | This page | All four modes on one free page |
🔧 15. Troubleshooting and Common Errors
My answer is one day different from another website
Cause: one tool counts the end date and the other does not. Fix: change "Count the end date?" and compare again. This calculator does not count the end date by default, the same as Excel =B2-A2 and most online day counters.
The months and days differ from another calculator
Cause: tools split a range into months in different ways when the start day is the 29th, 30th or 31st. Fix: none is needed if the total days agree. This tool counts whole calendar months first and clamps short months, the same rule as Python relativedelta and Excel EDATE.
Excel gives a different number for dates in 1900
Cause: Excel treats 1900 as a leap year by mistake. Fix: for ranges that cross February 1900, use this calculator, R or Python. See 8.4.
The result has a minus sign
Cause: the end date is before the start date. Fix: swap the two dates, or keep the minus sign if you meant "how many days ago".
Working days look too high
Cause: public holidays are not in the list. Fix: open "Working days settings" and paste the holidays as YYYY-MM-DD dates.
Business days moved further than I expected
Cause: the start date fell on a weekend or holiday, or the weekend setting is wrong. Fix: check the weekend setting. The start date itself is never counted.
Adding 1 month to 31 January gave 28 February
Cause: February has no 31st. Fix: this is correct and matches Excel. If you want "30 days later", use 30 days instead of 1 month.
"Not a real calendar date" error
Cause: a date such as 31 April or 29 February in a common year, or an empty field. Fix: pick the date from the calendar picker.
Holiday list error
Cause: a holiday is written as 25/12/2026 or "Christmas". Fix: write each one as 2026-12-25 and separate them with commas.
Hours are one off around March, October or November
Cause: a daylight saving change in your area. Fix: this page uses clock times without time zones. Add or remove the hour by hand if the clocks changed inside your range.
The age is one year lower than I expected
Cause: the birthday has not come yet in the as-of year. Fix: none; age counts completed years. The "Next birthday" line shows when it changes.
The charts did not appear
Cause: the chart library was blocked by an ad blocker or a slow connection. Fix: reload the page. Every number is still in the tables.
⚖ 16. Assumptions and Limitations
- Gregorian calendar everywhere. Dates before 1582 are treated as if the Gregorian calendar had always existed (the proleptic calendar). Historical dates written in the old Julian calendar will be off by 10 or more days. Better choice: convert Julian dates first.
- The end date is not counted by default. If your rule counts both ends, results are 1 day too low until you switch the setting on.
- Months are calendar months with a month-end clamp. A rule that defines a month as 30 days will give a different date. Better choice: add 30 days.
- Leap-day birthdays move to 28 February. In common years a person born on 29 February turns a year older on 28 February here. Some laws (for example in the UK) use 1 March, so the age would be 1 day later.
- Clock times have no time zone. If daylight saving starts or ends inside the range, the real elapsed time is 1 hour less or more than shown.
- Working days use your weekend and your holiday list only. Half days, regional holidays and company shutdowns are not known unless you list them.
- Years 1 to 9999 only. That covers every practical date.
- Leap seconds are ignored. They change UTC by at most a second and never change a date.
🏁 17. Conclusion
___ Run the calculator above and your conclusion will be written here with your own dates.
In short, a date calculator turns each date into a day number, subtracts, and then translates the gap back into the units you care about: days, weeks, months, working days, hours or an age. The only decision you must make yourself is whether the first and last days count. Get that right and this date calculator will give the same answer as Excel, R and Python every time.
❓ 18. Frequently Asked Questions
Q1. What is a date calculator?
A date calculator is a tool that counts the days between two dates or finds a new date after adding or subtracting time. This one also counts working days, adds business days, measures date and time durations, and works out exact age on any date, using real month lengths and leap years.
Q2. How do I calculate the number of days between two dates?
Subtract the earlier date from the later one. Turn each date into a day number and take the difference. For example, 31 March 2027 minus 17 November 2026 is 134 days. In this calculator, choose Days Between Dates, enter both dates and press Calculate.
Q3. Does a date calculator include the end date?
By default this date calculator does not count the end date, so it gives the gap between the dates, the same as Excel =B2-A2. Choose "Yes, count both dates" to add one day, which you need for days of leave, events or "from 1 May to 10 May" style ranges.
Q4. How do I add days to a date?
Choose the Add / Subtract tab, enter the start date, type the number of days and press Calculate. For example, 17 November 2026 plus 90 days is Monday 15 February 2027. You can add weeks, months and years in the same step.
Q5. What date is 90 days from today?
Press Today in the Add / Subtract tab, type 90 in Days and press Calculate. The answer changes every day. For example, 90 days from 17 November 2026 is 15 February 2027, and 90 days from 1 January 2027 is 1 April 2027.
Q6. How do I calculate business days between two dates?
Use the Days Between Dates tab. The Working days line counts Monday to Friday with both dates included, the same as Excel NETWORKDAYS. Add public holidays in the settings to remove them. From 17 November 2026 to 31 March 2027 there are 97 working days.
Q7. How do I add business days to a date?
Choose the Business Days tab, enter the start date and the number of business days, then press Calculate. Weekends and listed holidays are skipped and the start date is not counted. 10 business days after 22 December 2026, skipping 25 December and 1 January, is 7 January 2027.
Q8. How do I calculate weeks between two dates?
Divide the days between the dates by 7. The whole number is the weeks and the remainder is the extra days. 134 days is 19 weeks and 1 day. The calculator shows this on the Weeks line, and in Excel you can use =INT((B2-A2)/7).
Q9. How many months are between two dates?
Count whole calendar months forward from the start date, then the leftover days. From 17 November 2026 to 31 March 2027 is 4 months and 14 days. This calculator shows full months separately, and Excel gives the same with =DATEDIF(A2,B2,"M").
Q10. How do I calculate age on a specific date?
Choose the Age on a Date tab, enter the date of birth and the date you want the age on, then press Calculate. You get completed years, months and days. Someone born on 15 August 1990 is 36 years, 3 months and 2 days old on 17 November 2026.
Q11. How do you calculate age from date of birth in Excel?
Use =DATEDIF(A2,TODAY(),"Y") with the date of birth in A2 for age in whole years today. Replace TODAY() with a date cell for age on a specific date. Add DATEDIF with "YM" and "MD" to get the months and days as well.
Q12. How do I calculate days between dates in Excel?
Type the two dates in A2 and B2 and enter =B2-A2 in another cell, then format it as General. Add +1 to count both dates. Use =NETWORKDAYS(A2,B2) for working days and =DATEDIF(A2,B2,"YM") for months left after whole years.
Q13. How do I calculate the difference between two dates in R?
Convert the text to dates with as.Date() and subtract: as.numeric(as.Date("2027-03-31") - as.Date("2026-11-17")) returns 134. For years, months and days use the ymd_diff() function in Section 9, or the lubridate package. Use seq() with format(d, "%u") to count working days, as the full script on this page shows.
Q14. How do I calculate days between two dates in Python?
Subtract two date objects and read .days: (date(2027, 3, 31) - date(2026, 11, 17)).days returns 134. Use dateutil.relativedelta for years, months and days, and numpy.busday_count for working days, as shown in Section 10. Add one day to the end date first so busday_count matches Excel NETWORKDAYS.
Q15. How do I calculate time between two dates with hours and minutes?
In the Days Between Dates tab, set "Add times of day?" to Yes and enter a start and end time. The calculator multiplies whole days by 1,440 minutes and adds the clock difference. 17 November 09:30 to 20 November 17:45 is 3 days, 8 hours and 15 minutes, or 80.25 hours.
Q16. How does a date calculator handle leap years?
It uses the Gregorian rule: a year is a leap year if it divides by 4, except century years, which must divide by 400. So 2028 and 2000 are leap years, but 1900 and 2100 are not. Every 29 February inside your range is counted automatically.
Q17. What is 1 month after 31 January?
It is 28 February, or 29 February in a leap year, because February has no 31st. This calculator, Excel EDATE and most banks move the date to the last day of the shorter month. Two months after 31 January is 31 March again.
Q18. What is a year to date calculation?
Year to date means from 1 January of the current year up to a chosen date. Enter 1 January as the start date and your date as the end, and set "count both dates" to Yes. 1 January to 17 November 2026 is 321 days, which is the day-of-year number.
Q19. Why do date calculators give different answers?
Almost always because one tool counts the end date and another does not, or because they split months differently when the start day is the 29th, 30th or 31st. The total days agree once the counting rule matches. This page tells you which rule it used for every number.
Q20. Is this date calculator free and accurate?
Yes. It is free, needs no sign-up, and runs in your browser. Its date engine was checked against Python on 4,000 random date pairs for days, months, working days, weekdays and week numbers with no differences. It covers every date from year 1 to 9999.
📑 19. Cite This Tool
Reegan. (2026). Date calculator: Days between dates, add or subtract dates, business days and age [Online calculator]. StatsUnlock. https://statsunlock.com/date-calculator/@misc{statsunlock_datecalc_2026, title={Date Calculator: Days Between Dates, Add or Subtract Dates, Business Days and Age}, author={Reegan}, year={2026}, howpublished={StatsUnlock}, url={https://statsunlock.com/date-calculator/}, note={Accessed: 2026-11-17}}Date intervals were calculated with the StatsUnlock Date Calculator (Reegan, 2026), which uses the proleptic Gregorian calendar with exact month lengths and leap-year rules. Day counts exclude the end date unless stated, and working days exclude Saturdays, Sundays and listed public holidays.🔗 20. Related Tools
A focused tool for adding or subtracting days from one date.
The date 90 days ahead, updated every day.
Exact years, months and days from a date of birth.
Weeks, ISO weeks and 53-week years explained.
Every everyday calculator on StatsUnlock in one place.
A free online maths solver that shows every step.
Equation solvers, fractions, percentages and more.
Summarise dates, durations and any other numbers you collect.
📖 21. Glossary of Terms
| Term | Plain-English meaning |
|---|---|
| Age on a specific date | How old someone is on a chosen day, in completed years, months and days. |
| Business day | A working day: not a weekend day and not a listed holiday. Also called a working day. |
| Calendar day | Any day on the calendar, including weekends and holidays. |
| Common year | A year with 365 days, so not a leap year. |
| Date and time duration | The time between two moments, each given as a date plus a clock time. |
| Date serial number | A date stored as a whole number of days from a fixed start, as Excel does. |
| DATEDIF | A hidden Excel function that gives whole years, months or days between two dates. |
| Day number | The same idea as a serial number: one whole number for each calendar date. |
| Day of the year | The position of a date in its year: 1 January is day 1, 31 December is day 365 or 366. |
| Exclusive count | A day count that leaves out the end date. It measures the gap between two dates. |
| Fence-post error | Being off by one because you counted gaps when you meant points, or the other way round. |
| Gregorian calendar | The calendar most of the world uses today, introduced in 1582, with its leap-year rule. |
| Holiday list | Dates you enter that should not count as working days. |
| Inclusive count | A day count that includes both the start and end date. It is the exclusive count plus 1. |
| ISO week | A week number that starts on Monday. Week 1 is the week with the year's first Thursday. |
| Leap day | 29 February, the extra day added in a leap year. |
| Leap year | A year with 366 days: divisible by 4, except century years that are not divisible by 400. |
| Month-end clamp | Moving a date to the last day of a month when the day number does not exist there, such as 31 to 28 February. |
| NETWORKDAYS | The Excel function that counts working days between two dates, both dates included. |
| Proleptic calendar | A calendar used for dates before it was invented, as if it had always existed. |
| Weekend | The days of rest each week, usually Saturday and Sunday. This calculator lets you choose. |
| WORKDAY | The Excel function that finds the date a number of working days away. The start date is not counted. |
📚 22. References
Peer-reviewed sources for the calendar algorithms, interval reasoning, time standards, spreadsheet date errors and the software used in this date calculator.
- Abeysooriya, M., Soria, M., Kasu, M. S., & Ziemann, M. (2021). Gene name errors: Lessons not learned. PLOS Computational Biology, 17(7), e1008984. https://doi.org/10.1371/journal.pcbi.1008984
- Allen, J. F. (1983). Maintaining knowledge about temporal intervals. Communications of the ACM, 26(11), 832–843. https://doi.org/10.1145/182.358434
- Allen, J. F., & Ferguson, G. (1994). Actions and events in interval temporal logic. Journal of Logic and Computation, 4(5), 531–579. https://doi.org/10.1093/logcom/4.5.531
- American College of Obstetricians and Gynecologists. (2017). Committee Opinion No 700: Methods for estimating the due date. Obstetrics & Gynecology, 129(5), e150–e154. https://doi.org/10.1097/AOG.0000000000002046
- Dershowitz, N., & Reingold, E. M. (1990). Calendrical calculations. Software: Practice and Experience, 20(9), 899–928. https://doi.org/10.1002/spe.4380200905
- Fliegel, H. F., & Van Flandern, T. C. (1968). A machine algorithm for processing calendar dates. Communications of the ACM, 11(10), 657. https://doi.org/10.1145/364096.364097
- Grolemund, G., & Wickham, H. (2011). Dates and times made easy with lubridate. Journal of Statistical Software, 40(3), 1–25. https://doi.org/10.18637/jss.v040.i03
- Harris, C. R., Millman, K. J., van der Walt, S. J., et al. (2020). Array programming with NumPy. Nature, 585(7825), 357–362. https://doi.org/10.1038/s41586-020-2649-2
- Hunter, J. D. (2007). Matplotlib: A 2D graphics environment. Computing in Science & Engineering, 9(3), 90–95. https://doi.org/10.1109/MCSE.2007.55
- Kamp, P.-H. (2011). The one-second war. Communications of the ACM, 54(5), 44–48. https://doi.org/10.1145/1941487.1941505
- Kantermann, T., Juda, M., Merrow, M., & Roenneberg, T. (2007). The human circadian clock's seasonal adjustment is disrupted by daylight saving time. Current Biology, 17(22), 1996–2000. https://doi.org/10.1016/j.cub.2007.10.025
- McCarthy, D. D. (1991). Astronomical time. Proceedings of the IEEE, 79(7), 915–920. https://doi.org/10.1109/5.84967
- Nelson, R. A., McCarthy, D. D., Malys, S., Levine, J., Guinot, B., Fliegel, H. F., Beard, R. L., & Bartholomew, T. R. (2001). The leap second: Its history and possible future. Metrologia, 38(6), 509–529. https://doi.org/10.1088/0026-1394/38/6/6
- Panko, R. R. (1998). What we know about spreadsheet errors. Journal of Organizational and End User Computing, 10(2), 15–21. https://doi.org/10.4018/joeuc.1998040102
- Reingold, E. M., Dershowitz, N., & Clamen, S. M. (1993). Calendrical calculations, II: Three historical calendars. Software: Practice and Experience, 23(4), 383–404. https://doi.org/10.1002/spe.4380230404
- Savitz, D. A., Terry, J. W., Jr., Dole, N., Thorp, J. M., Jr., Siega-Riz, A. M., & Herring, A. H. (2002). Comparison of pregnancy dating by last menstrual period, ultrasound scanning, and their combination. American Journal of Obstetrics and Gynecology, 187(6), 1660–1666. https://doi.org/10.1067/mob.2002.127601
- Snodgrass, R. (1987). The temporal query language TQuel. ACM Transactions on Database Systems, 12(2), 247–298. https://doi.org/10.1145/22952.22956
- Snodgrass, R., & Ahn, I. (1986). Temporal databases. Computer, 19(9), 35–42. https://doi.org/10.1109/MC.1986.1663327
- WHO Multicentre Growth Reference Study Group. (2006). WHO Child Growth Standards based on length/height, weight and age. Acta Paediatrica, 95(S450), 76–85. https://doi.org/10.1111/j.1651-2227.2006.tb02378.x
- Ziemann, M., Eren, Y., & El-Osta, A. (2016). Gene name errors are widespread in the scientific literature. Genome Biology, 17, 177. https://doi.org/10.1186/s13059-016-1044-7
