Catalog/datetime-working-hours-between

Date & Time

Working hours between times API

Sums the working hours between two ISO datetimes given a daily workday window (e.g. 09:00-17:00), a weekend mask and holidays, clamping each day to the open window. Answers 'How many working hours elapsed between two timestamps?', 'Billable in-office hours over this span?'.

Price$0.06per request
MethodPOST
Route/v1/datetime/working-hours-between
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
datetimeworking-hoursbusiness-hoursslaelapsedworkdayoffice-hoursduration
API URLhttps://x402.hexl.dev/v1/datetime/working-hours-between
Integration docs
Example request
{
  "start": "2026-03-02T08:00:00Z",
  "end": "2026-03-03T11:30:00Z"
}
Example response
{
  "start": "2026-03-02T08:00:00.000Z",
  "end": "2026-03-03T11:30:00.000Z",
  "workdayStart": "09:00",
  "workdayEnd": "17:00",
  "workingMinutes": 630,
  "workingHours": 10.5,
  "workingDayLengthHours": 8,
  "interpretation": "10.5 working hour(s) between the two timestamps given a 09:00–17:00 workday, excluding weekends/holidays."
}
Input schema
{
  "type": "object",
  "required": [
    "start",
    "end"
  ],
  "properties": {
    "start": {
      "type": "string",
      "examples": [
        "2026-03-02T08:00:00Z"
      ]
    },
    "end": {
      "type": "string",
      "examples": [
        "2026-03-03T11:30:00Z"
      ]
    },
    "workdayStart": {
      "type": "string",
      "examples": [
        "09:00"
      ]
    },
    "workdayEnd": {
      "type": "string",
      "examples": [
        "17:00"
      ]
    },
    "weekendDays": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "holidays": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}