HomeAll CategoriesDate Calculator: Days Between Dates, Add Days & Age (Free)

Date Calculator: Days Between Dates, Add Days & Age (Free)

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.

Days Between DatesAdd & SubtractBusiness DaysDate & Time DurationAge on a DateExcel, R & Python

🧮 1. Date Calculator

Inputs

Pick an example to see its result straight away. Edit any box and press Calculate to update.
Hotel nights: No. Days of leave or a festival: Yes.
Whole numbers. Years and months are applied first, then weeks and days.
The start date itself is not counted, the same as Excel WORKDAY.
Pick any past or future date to see the age on that specific date.
Working days settings: weekend and holidays
YYYY-MM-DD, separated by commas or new lines.

Your Result

___
Press Calculate
Breakdown
___

Full breakdown, charts and exports are in Section 2 below.

Calculation
Days = serial(end) − serial(start)
___ − ___ = ___ days

Download your result as a plain text file.

📊 2. Your Results

Choose a mode above, enter your dates, then press Calculate. Your full breakdown, the working-day split, a month-by-month table, two charts and the export buttons will appear here.

⚡ 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.

Days between = end date − start date  (+1 if both dates count)
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.

DecJanFebMar17 Nov 2026serial 46,34331 Mar 2027serial 46,47746,477 - 46,343 = 134 days
A date range drawn as a timeline. Each date becomes a day number, and the gap between the numbers is the answer.

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

MethodGood atWhere it goes wrong
This date calculatorExact days, Y/M/D, working days, age, any date from year 1 to 9999Needs you to say whether the end date counts
Counting on a paper calendarShort ranges, a week or twoEasy to lose count, miss a leap day, or count both ends by accident
Excel or Google SheetsMany rows at once with =B2-A2, NETWORKDAYS, DATEDIFText dates, the 1900 leap-year bug, DATEDIF "MD" errors (Section 8)
"30 days per month" shortcutQuick rough guessWrong 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.

1. Plain summary to save or share
___ Run the calculator above to fill this card.
2. Questions to ask your manager, HR, client or lawyer
___ Run the calculator above to fill this card.
3. Milestone plan built from your range
___ Run the calculator above to fill this card.
4. Reminder schedule before the end date
___ Run the calculator above to fill this card.
5. Formal wording for a report or document
___ 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).

①
Days between two dates
Days = N(end) − N(start)    Inclusive days = N(end) − N(start) + 1
N(date)The day number of a date, a whole number of days from a fixed start point
+ 1Added only when both the start and the end day are counted
Example46,477 − 46,343 = 134 days (17 Nov 2026 to 31 Mar 2027)
RuleA negative answer means the end date is before the start date
②
Turning a date into a day number
y′ = y − 1 if m ≤ 2  ·  N = 365y′ + ⌊y′/4⌋ − ⌊y′/100⌋ + ⌊y′/400⌋ + ⌊(153m′ + 2)/5⌋ + d − offset
y, m, dYear, month (1 to 12) and day of the date
m′Month counted from March: March = 0 ... February = 11, so the leap day falls at the end of the year
⌊ ⌋Round down to a whole number
offsetA constant that sets day 0, unitless (this page uses the Excel scale for display)
WhyWhole-number maths only, so no time zone or daylight saving can move a date
③
Leap year rule (Gregorian calendar)
Leap if (y mod 4 = 0 and y mod 100 ≠ 0) or y mod 400 = 0
yThe year, a whole number
modThe remainder after division
Example2028 leap; 2100 not leap; 2000 leap
Result400 years hold exactly 146,097 days, an average year of 365.2425 days
④
Years, months and days between two dates
n = largest whole months with AddMonths(start, n) ≤ end  ·  Y = ⌊n/12⌋, M = n mod 12, D = end − AddMonths(start, n)
nCompleted calendar months, unitless count
Y, M, DYears, months and leftover days of the answer
Example17 Nov 2026 + 4 months = 17 Mar 2027; + 14 days = 31 Mar 2027, so 4 months 14 days
MatchesPython dateutil relativedelta, checked on 4,000 random date pairs
⑤
Adding months, with the month-end clamp
AddMonths(y, m, d, k) = (y₀, m₀, min(d, DaysInMonth(y₀, m₀)))
kMonths to add, negative to subtract
y₀, m₀The target year and month after moving k months
minUse the smaller of the two: the original day, or the last day of the target month
Example31 Jan 2026 + 1 month = 28 Feb 2026, same as Excel EDATE
OrderYears and months first, then weeks × 7 and days
⑥
Working days (business days)
Working days = inclusive days − weekend days − holidays on weekdays
inclusive daysN(end) − N(start) + 1, both dates counted
weekend daysDays on your chosen weekend, for example Saturday and Sunday
holidaysListed holidays that fall on a working day, each counted once
MatchesExcel NETWORKDAYS and NETWORKDAYS.INTL; adding business days matches WORKDAY
Weekday(N + 4) mod 7 on a 1970-based count gives 0 = Sunday ... 6 = Saturday
⑦
Date and time duration, and unit conversions
Minutes = (N(end) − N(start)) × 1440 + (t₂ − t₁)  ·  Hours = days × 24  ·  Weeks = days ÷ 7
t₁, t₂Start and end clock times in minutes after midnight
1440Minutes in one day (24 × 60)
Example17 Nov 09:30 to 20 Nov 17:45 = 3 × 1440 + 495 = 4,815 min = 80.25 hours
Decimal yearsDays ÷ 365.2425, the average Gregorian year

📝 7. How to Use This Date Calculator

The worked example below counts the days from 17 November 2026 to 31 March 2027.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Set the weekend and holidays. Open Working days settings, choose your weekend, and paste public holidays as YYYY-MM-DD dates.
  7. Press Calculate. Press the Calculate button. Nothing is worked out until you do, so your inputs are never overwritten.
  8. 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.
  9. Check the full breakdown. Scroll to Section 2 for weeks, working days (97), hours, the month-by-month table and the two charts.
  10. 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

TaskFormulaResult for the example
Days between two dates=B2-A2 or =DAYS(B2,A2)134
Days, counting both dates=B2-A2+1135
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+9015-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.

Xdates.xlsx - ExcelA2fx17/11/2026AB1Start dateEnd date217-Nov-202631-Mar-2027

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+1

Plain 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.

Xdates.xlsx - ExcelC2fx=B2-A2ABCD1StartEndDaysBoth counted217-Nov-202631-Mar-2027134135

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.

Xdates.xlsx - ExcelE2fx=DATEDIF(A2,B2,"Y")&" y "&DATEDIF(A2,B2,"YM")&" m "&...ABCDE1StartEndYMMDY / M / D217-Nov-202631-Mar-20274140 y 4 m 14 d

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.

Xdates.xlsx - ExcelD2fx=NETWORKDAYS(A2,B2,H2:H3)ABCDH1StartEndWork daysMinus holidaysHolidays217-Nov-202631-Mar-2027979525-Dec-2026301-Jan-2027

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.

Xdates.xlsx - ExcelB4fx=WORKDAY(DATE(2026,12,22),10,H2:H3)AB1QuestionAnswer217-Nov-2026 + 90 days15-Feb-2027331-Jan-2026 + 1 month28-Feb-2026410 work days after 22-Dec07-Jan-2027

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.

Xdates.xlsx - ExcelC5fx=DATEDIF(A5,B5,"Y")ABCDE1BornAge onYearsMonthsDays234515-Aug-199017-Nov-20263632

Born 15-Aug-1990, the age on 17-Nov-2026 is 36 years, 3 months, 2 days, exactly what the Age tab shows.

Tip: =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]:mm to show 80:15.
  • End date before start date. =B2-A2 gives a negative number, which is fine. DATEDIF returns #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.
Watch out: Microsoft's own help page warns that 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

SituationWhat happensFix
Dates before 1 March 1900Excel 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,524Trust this calculator, R or Python for dates before March 1900
Dates before 1900Excel cannot store them at all; they stay as textUse R, Python or this calculator
DATEDIF "MD" near month endsCan be off by a day or negativeUse the leftover-days method in Section 6, card 4
Counting both dates=B2-A2 excludes the end date but NETWORKDAYS includes bothBe 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 yearsFile, Options, Advanced: untick "Use 1904 date system", or keep both files on the same system
Times and daylight savingExcel ignores time zones; Python and R may not if you give them oneUse 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

ErrorCauseFix
#VALUE!One of the "dates" is text, often from a CSV or a copied web pageUse =DATEVALUE(A2), or Data, Text to Columns, choose the date order
#NUM!DATEDIF start date is later than the end dateSwap the dates or use MIN and MAX
#####The column is too narrow, or a date formula returned a negative numberWiden the column, or format the cell as General
#NAME?A function name is misspelt, or the file is very old and lacks NETWORKDAYS.INTLCheck the spelling; use Excel 2010 or newer
A date instead of a numberExcel copied the date format into the result cellHome, 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 functionWhat 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 - startSubtracting 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

ProblemFix
character string is not in a standard unambiguous formatGive 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 languageUse format(d, "%u") numbers, as the script does
Hours off by one around March or OctoberUse tz = "UTC" in as.POSIXct()
Want lubridate insteadlibrary(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.

datetimedates, times and day gaps, standard library
python-dateutilrelativedelta for years, months and days
numpybusday_count and busday_offset for working days
matplotlibthe 300 dpi figure

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 functionWhat 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).daysSubtracting 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() / 3600Date 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

ProblemFix
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 Excelbusday_count excludes the end date; add one day to it, as the script does
Text dates from a CSVdatetime.strptime("17/11/2026", "%d/%m/%Y").date(), or parse_dates in pandas
pandas months look wrongpd.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

MonthDays (common year)Days (leap year)Day of year at month end (common)Day of year at month end (leap)
January31313131
February28295960
March31319091
April3030120121
May3131151152
June3030181182
July3131212213
August3131243244
September3030273274
October3131304305
November3030334335
December3131365366

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

UnitDaysHoursNote
1 day1241,440 minutes, 86,400 seconds
1 week7168
1 fortnight14336
1 month (average)30.436875730.485Real months are 28 to 31 days
1 quarter (average)91.3106252,191.455Real quarters are 90 to 92 days
1 common year3658,76052 weeks + 1 day
1 leap year3668,78452 weeks + 2 days
1 average Gregorian year365.24258,765.82Used for decimal years
400-year cycle146,0973,506,328Exactly 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 yearsCount
2000, 2004, 2008, 2012, 2016, 2020, 2024, 20288
2032, 2036, 2040, 2044, 2048, 2052, 2056, 20608

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)

Month20262027
January2221
February2020
March2223
April2222
May2121
June2222
July2322
August2122
September2222
October2221
November2122
December2323
Whole year261261

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?

AddResult date
7 daysFriday, 8 January 2027
14 daysFriday, 15 January 2027
30 daysSunday, 31 January 2027
45 daysMonday, 15 February 2027
60 daysTuesday, 2 March 2027
90 daysThursday, 1 April 2027
100 daysSunday, 11 April 2027
120 daysSaturday, 1 May 2027
180 daysWednesday, 30 June 2027
270 daysTuesday, 28 September 2027
365 daysSaturday, 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

CodeWeekend daysCodeWeekend day
1Saturday, Sunday11Sunday only
2Sunday, Monday12Monday only
3Monday, Tuesday13Tuesday only
4Tuesday, Wednesday14Wednesday only
5Wednesday, Thursday15Thursday only
6Thursday, Friday16Friday only
7Friday, Saturday17Saturday 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

YearQ1Q2Q3Q4H1Full year
202690919292181365
202790919292181365
202891919292182366

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.

1
TEXTBOOK CASE

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.

364 days apart365 days long261 working days52 weeks + 1 day
MeasureValueNote
StartThursday, 1 January 2026Thursday
EndThursday, 31 December 2026Thursday
Days apart (end not counted)364=B2-A2 in Excel
Days long (both counted)365Common year
Working days, Mon to Fri261Before public holidays
Weekend days10452 Saturdays + 52 Sundays
Weeks52 weeks, 1 day365 = 52 x 7 + 1
FebMarAprMayJunJulAugSepOctNovDec1 Jan 2026Thursday31 Dec 2026Thursday365 days, both ends counted
A full year: the start and end dates are both Thursdays, because 365 days is 52 weeks plus 1 day.

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.

2
EXTREME INPUT

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.

36,524 days100 years24 leap daysExcel says 36,525
MeasureValueNote
Days between36,524End date not counted
Years, months, days100 years, 0 months, 0 daysExact
Leap days inside241904 to 1996; 1900 is not a leap year
Weeks5,217 weeks, 5 days
Excel =B2-A236,525One too many: Excel counts a fake 29 Feb 1900
1910192019301940195019601970198019901 Jan 1900Monday1 Jan 2000Saturday36,524 days (100 years)
One hundred years with only 24 leap days, because 1900 was a century year not divisible by 400.

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.

3
SHORT DURATION

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?

3 d 8 h 15 m80.25 hours4,815 minutes
MeasureValueNote
StartTue 17 Nov 2026, 09:30
EndFri 20 Nov 2026, 17:45
Whole days33 x 1440 = 4,320 minutes
Clock difference8 h 15 m17:45 - 09:30 = 495 minutes
Total minutes4,8154,320 + 495
Total hours80.254,815 / 60
18 Nov19 Nov20 Nov17 Nov 09:30Tuesday20 Nov 17:45Friday80.25 hours
Three full days plus 8 hours 15 minutes.

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.

4
BORDERLINE

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?

26 years (this tool)25 years (1 March rule)9,496 days lived
MeasureValueNote
BornTue 29 Feb 2000Leap day
Age onSat 28 Feb 2026Common year
Age here26 years, 0 months, 0 days28 Feb treated as the birthday
Age under 1 March rule25 yearsTurns 26 on 1 Mar 2026
Days lived9,496Same under both rules
20042008201220162020202429 Feb 2000Born28 Feb 2026Age 26 hereLeap-day birthday
Same number of days lived, but the age in years depends on which day counts as the birthday in a common year.

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.

5
MISLEADING READING

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?

+1 month = 28 Feb+2 months = 31 Marnot 3 March
MeasureValueNote
StartSat 31 Jan 2026
+ 1 monthSat 28 Feb 2026Clamped: February has no 31st
+ 2 monthsTue 31 Mar 2026March has a 31st again
+ 30 days insteadMon 2 Mar 2026A fixed day count gives a different date
Excel=EDATE(DATE(2026,1,31),1)Also gives 28-Feb-2026
28 Feb31 Jan 2026Start31 Mar 2026+2 months+1 month = 28 Feb (clamped)
Each month is added from the original start date, so the 31st comes back in March.

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.

6
APPLIED

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.

7 Jan 202716 calendar days4 weekend days2 holidays
MeasureValueNote
StartTue 22 Dec 2026Not counted
Business days10Mon to Fri
Holidays skipped25 Dec, 1 JanBoth Fridays
Weekend days skipped426, 27 Dec and 2, 3 Jan
ResultThu 7 Jan 2027Same as Excel WORKDAY
Without holidaysTue 5 Jan 2027Two days earlier
25 Dec1 Jan22 Dec 2026Order placed7 Jan 202710th business day10 business days = 16 calendar days
10 business days took 16 calendar days because of two weekends and two holidays.

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".

7
INVALID INPUT

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.

-364 dayswarning shown31 April rejected
MeasureValueNote
StartThu 31 Dec 2026
EndThu 1 Jan 2026Earlier than the start
Result-364 daysMinus sign means backwards
Y/M/D of the gap11 months, 30 daysMeasured from the earlier date
31 April 2027Error messageApril has 30 days
1 Jan 2026End date31 Dec 2026Start dateCounted backwards: -364 days
Reversed dates give a negative count, and impossible dates are stopped before any maths is done.

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".

8
APPLIED

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.

36 years3 months2 daysnext birthday in 271 days
MeasureValueNote
BornWed 15 Aug 1990
Age onTue 17 Nov 2026
Exact age36 years, 3 months, 2 daysSame as Excel DATEDIF
Age in months435 months, 2 days
Age in days13,243
Next birthdaySun 15 Aug 2027In 271 days, turning 37
20002010202015 Aug 1990Born17 Nov 2026Age 3636 years, 3 months, 2 days
Completed years are 36; the 37th birthday is still 271 days away.

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.

  1. 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".
  2. 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.
  3. 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.
  4. Decide whether the last day counts. Then set "Count the end date?" to match.
  5. Choose calendar days or business days. Shipping, banking and court rules often say "business days". Visas, leases and warranties usually say calendar days.
  6. Set the right weekend. Saturday and Sunday in most countries. Some countries and many shops use Friday and Saturday, or Sunday only.
  7. 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.
  8. Add times only when they matter. Use them for shifts, flights and service clocks. Use the same time zone for both times.
  9. For age, use the full date of birth. A birth year alone can be off by almost a whole year.
  10. Re-check after any change. A moved start date or a new holiday changes every result after it.
InputFormatValid rangeTypical example
Start date, end dateCalendar picker or YYYY-MM-DDYear 1 to 99992026-11-17
Times24-hour HH:MM00:00 to 23:5909:30
Years, months, weeks, days to addWhole numbers0 up to millions of days90 days
Business daysWhole number0 to 100,00010
HolidaysYYYY-MM-DD listAny number2026-12-25, 2027-01-01
Date of birth and as-of dateCalendar pickerAs-of date on or after birth1990-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

Use it when you need to:
  • 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
Do not use it alone when:
  • 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 questionUse
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 forWhere to find itWorked example
calculate number of days between two datesDays Between Dates17 Nov 2026 to 31 Mar 2027 = 134 days
calculate the number of days between 2 dates, counting bothDays Between Dates, "Count the end date?" = Yes135 days
calculate no of days between 2 dates in ExcelSection 8, step 2=B2-A2 returns 134
calculate how many days between dates are working daysDays Between Dates, Working days line97 working days
calculate the amount of days between two dates in weeksDays Between Dates, Weeks line19 weeks, 1 day
calculate weeks between 2 datesDays Between Dates, Weeks line134 / 7 = 19 weeks, 1 day
calculate duration between two dates in monthsDays Between Dates, Y/M/D line4 months, 14 days
calculate duration between dates and times (date and time duration calculator)Days Between Dates, "Add times of day?" = Yes80.25 hours
date and time calculator: add hours to a dateAdd / Subtract, "Include a time of day?" = Yes17 Nov 08:00 + 36 h = 18 Nov 20:00
date time calculator in minutes and secondsResults table, Total minutes and seconds134 days = 192,960 minutes
date calculator add days / date plus days calculatorAdd / Subtract, Days17 Nov 2026 + 90 days = 15 Feb 2027
add date calculator for months or yearsAdd / Subtract, Months or Years31 Jan 2026 + 1 month = 28 Feb 2026
date addition calculator for weeksAdd / Subtract, Weeks1 Mar 2027 minus 6 weeks = 18 Jan 2027
find future date calculatorAdd / Subtract, Add1 Jan 2027 + 180 days = 30 Jun 2027
days from date calculator / calculate days from dateAdd / Subtract, DaysInvoice 17 Nov 2026 + 30 days = 17 Dec 2026
days to date calculator (days until a date)Days Between Dates, Start = TodayDays left until your end date
business date calculatorBusiness Days10 business days after 22 Dec 2026 = 7 Jan 2027
age calculator on specific date / age date calculatorAge on a DateBorn 15 Aug 1990, on 17 Nov 2026: 36 y 3 m 2 d
calculate age based on date of birthAge on a Date, press TodayExact years, months and days today
how to calculate age in Excel using date of birthSection 8, step 6=DATEDIF(A5,TODAY(),"Y")
year to date calculatorDays Between Dates, 1 Jan to your date, both counted1 Jan to 17 Nov 2026 = 321 days
calendar date calculator / date and calendar calculatorAdd / Subtract with 0 days17 Nov 2026 is a Tuesday in ISO week 47
date range calculator / date count calculatorDays Between Dates, both countedLeave from 21 Dec to 2 Jan = 13 days
two dates calculator / date calculator two dates / date calculator between 2 datesDays Between Dates, dates in any orderReversed dates show a minus sign
date calculator between two dates / day date calculatorDays Between DatesDays, weekdays of both dates, Y/M/D
date duration calculator / date calculator duration / date and duration calculatorDays Between DatesTotal days, weeks, months, hours
date duration calculator days between dates / duration calculator between two datesDays Between Dates1 Jan 1900 to 1 Jan 2000 = 36,524 days
date calculator days / calculator days between dates / day between dates calculatorDays Between Dates1 Jan to 31 Dec 2026 = 364 days
calculating days between dates / calculate dates between two datesSection 6, card 1Day number of end minus day number of start
time calculator between dates / time between dates calculatorDays Between Dates, Total hours134 days = 3,216 hours
calculate days between two dates online / days calculator between dates onlineThis page, on any phone or computerNo sign-up, nothing to install
date calculator online / online date calculator / calculator for number of days between two datesThis pageAll 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Working days use your weekend and your holiday list only. Half days, regional holidays and company shutdowns are not known unless you list them.
  7. Years 1 to 9999 only. That covers every practical date.
  8. Leap seconds are ignored. They change UTC by at most a second and never change a date.
This date calculator gives exact calendar arithmetic. It is not legal, tax, immigration or medical advice. For a legal deadline, follow the counting rule in the law or contract that applies to you.

🏁 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

APA 7th edition
Reegan. (2026). Date calculator: Days between dates, add or subtract dates, business days and age [Online calculator]. StatsUnlock. https://statsunlock.com/date-calculator/
BibTeX
@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}}
How to mention it in a document
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

📖 21. Glossary of Terms

TermPlain-English meaning
Age on a specific dateHow old someone is on a chosen day, in completed years, months and days.
Business dayA working day: not a weekend day and not a listed holiday. Also called a working day.
Calendar dayAny day on the calendar, including weekends and holidays.
Common yearA year with 365 days, so not a leap year.
Date and time durationThe time between two moments, each given as a date plus a clock time.
Date serial numberA date stored as a whole number of days from a fixed start, as Excel does.
DATEDIFA hidden Excel function that gives whole years, months or days between two dates.
Day numberThe same idea as a serial number: one whole number for each calendar date.
Day of the yearThe position of a date in its year: 1 January is day 1, 31 December is day 365 or 366.
Exclusive countA day count that leaves out the end date. It measures the gap between two dates.
Fence-post errorBeing off by one because you counted gaps when you meant points, or the other way round.
Gregorian calendarThe calendar most of the world uses today, introduced in 1582, with its leap-year rule.
Holiday listDates you enter that should not count as working days.
Inclusive countA day count that includes both the start and end date. It is the exclusive count plus 1.
ISO weekA week number that starts on Monday. Week 1 is the week with the year's first Thursday.
Leap day29 February, the extra day added in a leap year.
Leap yearA year with 366 days: divisible by 4, except century years that are not divisible by 400.
Month-end clampMoving a date to the last day of a month when the day number does not exist there, such as 31 to 28 February.
NETWORKDAYSThe Excel function that counts working days between two dates, both dates included.
Proleptic calendarA calendar used for dates before it was invented, as if it had always existed.
WeekendThe days of rest each week, usually Saturday and Sunday. This calculator lets you choose.
WORKDAYThe 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.

  1. 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
  2. Allen, J. F. (1983). Maintaining knowledge about temporal intervals. Communications of the ACM, 26(11), 832–843. https://doi.org/10.1145/182.358434
  3. 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
  4. 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
  5. Dershowitz, N., & Reingold, E. M. (1990). Calendrical calculations. Software: Practice and Experience, 20(9), 899–928. https://doi.org/10.1002/spe.4380200905
  6. 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
  7. 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
  8. 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
  9. 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
  10. Kamp, P.-H. (2011). The one-second war. Communications of the ACM, 54(5), 44–48. https://doi.org/10.1145/1941487.1941505
  11. 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
  12. McCarthy, D. D. (1991). Astronomical time. Proceedings of the IEEE, 79(7), 915–920. https://doi.org/10.1109/5.84967
  13. 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
  14. 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
  15. 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
  16. 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
  17. Snodgrass, R. (1987). The temporal query language TQuel. ACM Transactions on Database Systems, 12(2), 247–298. https://doi.org/10.1145/22952.22956
  18. Snodgrass, R., & Ahn, I. (1986). Temporal databases. Computer, 19(9), 35–42. https://doi.org/10.1109/MC.1986.1663327
  19. 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
  20. 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
STATS UNLOCK · statsunlock.com · Date Calculator
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Statistical Models

Important Plots & Charts

Calculators and Converters