curatedapi

Working hours and SLA deadline calculator

The deadline a number of working hours after a start, or the working time between two moments, with office hours, weekends, public holidays and time zones.

When the clock starts: a date-time with a UTC offset, or a local time in timezone.
The IANA time zone the office hours are in.
Working hours allowed, to find the deadline. Unit: hours.
When the clock stops, to measure the working time.
When work starts each day, as HH:MM. At most 5 characters.
When work ends each day, as HH:MM; 24:00 for midnight. At most 5 characters.
The public holidays to leave out (2020 to 2030). Omit it to count only weekends and extra_holidays. Options: US: United States (federal holidays); GB-ENG: United Kingdom: England and Wales; GB-SCT: United Kingdom: Scotland; GB-NIR: United Kingdom: Northern Ireland; DE: Germany (the nine nationwide holidays); DE-BW: Germany: Baden-Württemberg; DE-BY: Germany: Bavaria; DE-BE: Germany: Berlin; DE-BB: Germany: Brandenburg; DE-HB: Germany: Bremen; DE-HH: Germany: Hamburg; DE-HE: Germany: Hesse; DE-MV: Germany: Mecklenburg-Vorpommern; DE-NI: Germany: Lower Saxony; DE-NW: Germany: North Rhine-Westphalia; DE-RP: Germany: Rhineland-Palatinate; DE-SL: Germany: Saarland; DE-SN: Germany: Saxony; DE-ST: Germany: Saxony-Anhalt; DE-SH: Germany: Schleswig-Holstein; DE-TH: Germany: Thuringia; FR: France (mainland); NL: Netherlands; IE: Ireland; BE: Belgium; AT: Austria; IT: Italy
Days of the week that are not worked. Options: sat_sun: Saturday and Sunday; fri_sat: Friday and Saturday; sun: Sunday only; fri: Friday only; none: no weekend days
More days that are not worked, such as company closing days. Up to 1000 items. One per line, or separated by commas.
More options: rounding and decimals
Precision and rounding
Rounding mode applied once to each result. Default half_even.
Round results to this many digits after the decimal point.
Round results to this many significant digits.

Examples

Example: Eight working hours from the afternoon of Christmas Eve 2026 in London

Deadline
The moment the working hours are used up, in the office's time zone.
2026-12-29T15:30:00+00:00
Deadline utc
The same moment in UTC.
2026-12-29T15:30:00Z
Weekday
The deadline's day of the week.
Tuesday
Tz database
The time zone data used.
tzdata 2026.6 (IANA 2026f)

Rounding: Half even, 4 decimal places. Calculator date/working-hours@1.

How it is calculated

working time = the part of [start, end] inside day_start to day_end on working days; the deadline is the earliest moment with add_hours of working time behind it

Answers the two questions a service-level agreement asks. When is the deadline, if a ticket opened now must be answered within 8 working hours? And how much working time passed between the moment it opened and the moment it closed? Working time is the office hours you give, in the office's time zone, on days that are not a weekend day, a public holiday of the chosen calendar or one of your own closing days. Time outside office hours does not count: a ticket opened on Friday evening starts its clock on Monday morning.

  • A deadline that falls exactly at closing time stays at closing time; it does not move to the next morning.
  • Hours are real elapsed time. If the clocks change inside office hours, that day has an hour less or more.
  • Holiday calendars cover 2020 to 2030. They follow the rules in each country's law, plus the one-off days that were proclaimed for a single year. A government can still add or move a day for a year ahead; such a change is added here when it becomes law.
  • Time zones come from the IANA time zone database in the pinned tzdata package; the version used is returned with each date-time result.

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Use it from your code

POST /v1/calc/date/working-hoursVersion 1
curl https://api.curatedapi.com/v1/calc/date/working-hours \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "start": "2026-12-24T15:30:00",
    "timezone": "Europe/London",
    "add_hours": "8",
    "calendar": "GB-ENG"
  }'
The same call in Python
import os

import requests

payload = {
    "start": "2026-12-24T15:30:00",
    "timezone": "Europe/London",
    "add_hours": "8",
    "calendar": "GB-ENG",
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/date/working-hours",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "start": "2026-12-24T15:30:00",
    "timezone": "Europe/London",
    "add_hours": "8",
    "calendar": "GB-ENG",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/date/working-hours", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_date_working_hours at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="date/working-hours" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Add this calculator to your website

Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.

Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.