General Utility · Tool

Day Calculator

Calculate the exact number of days, weeks, months, or years between two dates, or add/subtract time from a date, with options to exclude weekends and holidays.

EndpointPOST /v1/general-utility/day-calculatorVersionv1.0.0Added2026-05-26

Inputs

modeenumCalculator Mode
default "between" · one of: between, add_subtract
Choose between finding the days between two dates, or adding/subtracting days/weeks/months/years from a date.
start_datestringStart Date
default "2026-05-26"
Specify the starting date in YYYY-MM-DD format.
end_datestringEnd Date
default "2026-12-31"
Specify the ending date in YYYY-MM-DD format (used in 'between' mode).
include_start_end_daysbooleanInclude Both Start/End Dates in Count
default false
If true, adds 1 extra day to count both boundary days in the total.
operationenumOperation
default "add" · one of: add, subtract
Choose whether to add or subtract duration to the start date (used in 'add_subtract' mode).
yearsintegerYears
min 0 · max 1000 · default 0
monthsintegerMonths
min 0 · max 12000 · default 0
weeksintegerWeeks
min 0 · max 52000 · default 0
daysintegerDays
min 0 · max 365000 · default 0
holiday_presetenumHoliday Calendar Preset
default "us_federal" · one of: none, us_federal, india_national
Select a pre-configured country calendar for counting working days and public holidays.
exclude_weekendsbooleanExclude Weekends
default false
Exclude Saturday and Sunday from the count in 'between' mode.
exclude_holidaysbooleanExclude Public Holidays
default false
Exclude holidays of the selected calendar from the count in 'between' mode.
skip_weekendsbooleanSkip Weekends when Adding/Subtracting
default false
If true, added days will only count business days, skipping Saturdays/Sundays (used in 'add_subtract' mode).
skip_holidaysbooleanSkip Holidays when Adding/Subtracting
default false
If true, added days will skip calendar public holidays (used in 'add_subtract' mode).

Outputs

verdictstringVerdict
total_daysintegerTotal Calendar Days
working_daysintegerWorking Days
weekend_daysintegerWeekend Days
holidays_countintegerPublic Holidays
breakdownstringTime Breakdown
alternative_unitsstringAlternative Units
result_datestringResulting Date
holidays_liststringObserved Holidays falling in range
assumptions_notestringNotes

Example request

curl -X POST https://toolsamurai.com/api/v1/general-utility/day-calculator \
  -H "Authorization: Bearer sk_free_•••••••••••••••" \
  -H "Content-Type: application/json" \
  -d '{
       "mode": "between",
       "start_date": "2026-05-26",
       "end_date": "2026-12-31",
       "include_start_end_days": false,
       "operation": "add",
       "years": 0,
       "months": 0,
       "weeks": 0,
       "days": 0,
       "holiday_preset": "us_federal",
       "exclude_weekends": false,
       "exclude_holidays": false,
       "skip_weekends": false,
       "skip_holidays": false
     }'

Example response

200 OK
{
  "ok": true,
  "tool": "day-calculator",
  "domain": "general-utility",
  "version": "1.0.0",
  "result": {
    "verdict": "…",
    "total_days": ,
    "working_days": ,
    "weekend_days": ,
    "holidays_count": ,
    "breakdown": "…",
    "alternative_units": "…",
    "result_date": "…",
    "holidays_list": "…",
    "assumptions_note": "…"
  },
  "meta": { "latency_ms": , "request_id": "req_…" }
}

Tags

day-calculatordate-calculatordays-between-datesdate-mathworking-daysbusiness-daysholidaysduration