ToolAssay

Date Math

Date Math: How many days, weeks, months or business days between two dates or datetimes: calendar (Y/M/D), totals, and business days (weekdays in [from, to) minus holidays; pass country to exclude its public holidays). Use for age, tenure, countdowns, notice periods and working days until a deadline.

Answeringour last check, 2026-11-26
7 of 7checks answered this week
27 msmedian answer time
$0.001listed price per call
$0.001price it asked us

Paid test badge: not yet. The checks above are free: we call the tool without paying and read the payment request it sends back. The Verified badge needs paid calls whose answers match the promised output, and nobody can buy a badge.

Endpoint

POST https://date-math.datemath.workers.dev/v1/diff

CategoryEverything else
Provider hostdate-math.datemath.workers.dev
Networkseip155:8453
Payment schemesexact
Self-reported calls, 30 days2 from 1 payers (the provider's figure, not ours)

Our checks, last 30 days

DayResultHTTPAskedTime
2026-11-26 valid payment request 402$0.001 35 ms
2026-11-25 valid payment request 402$0.001 49 ms
2026-11-24 valid payment request 402$0.001 27 ms
2026-11-23 valid payment request 402$0.001 17 ms
2026-11-22 valid payment request 402$0.001 23 ms
2026-11-21 valid payment request 402$0.001 30 ms
2026-11-20 valid payment request 402$0.001 23 ms
2026-11-19 valid payment request 402$0.001 30 ms
2026-11-18 valid payment request 402$0.001 33 ms
2026-11-17 valid payment request 402$0.001 34 ms
2026-11-16 valid payment request 402$0.001 30 ms
2026-11-15 valid payment request 402$0.001 27 ms
2026-11-14 valid payment request 402$0.001 29 ms
2026-11-13 valid payment request 402$0.001 37 ms
2026-11-12 valid payment request 402$0.001 30 ms
2026-11-11 valid payment request 402$0.001 37 ms
2026-11-10 valid payment request 402$0.001 29 ms
2026-11-09 valid payment request 402$0.001 31 ms
2026-11-08 valid payment request 402$0.001 35 ms
2026-11-07 valid payment request 402$0.001 22 ms

Example input (from the provider)

{
  "body": {
    "country": "US",
    "from": "2026-01-31",
    "to": "2026-03-15"
  },
  "bodyType": "json",
  "method": "POST",
  "type": "http"
}

Promised output schema (from the provider)

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "input": {
      "additionalProperties": false,
      "properties": {
        "body": {
          "description": "business_days counts working days (default Mon\u2013Fri, see workdays) in [from, to) minus holidays; only for date inputs.",
          "properties": {
            "country": {
              "description": "ISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000\u20132050) are excluded from business days",
              "example": "US",
              "pattern": "^[A-Za-z]{2}$",
              "type": "string"
            },
            "from": {
              "description": "YYYY-MM-DD, or ISO 8601 datetime with Z or offset",
              "example": "2026-11-07T14:30:00Z",
              "type": "string"
            },
            "holidays": {
              "description": "Extra dates excluded from business-day counts (rest days from workdays are always excluded)",
              "items": {
                "example": "2026-11-07",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              "maxItems": 1000,
              "type": "array"
            },
            "to": {
              "description": "YYYY-MM-DD, or ISO 8601 datetime with Z or offset",
              "example": "2026-11-07T14:30:00Z",
              "type": "string"
            },
            "workdays": {
              "description": "Working days of the week, 0 = Sunday. Default [1,2,3,4,5] (Mon\u2013Fri); e.g. [0,1,2,3,4] for Sun\u2013Thu or [1,2,3,4,5,6] for Mon\u2013Sat",
              "example": [
                1,
                2,
                3,
                4,
                5
              ],
              "items": {
                "maximum": 6,
                "minimum": 0,
                "type": "integer"
              },
              "maxItems": 7,
              "minItems": 1,
              "type": "array"
            }
          },
          "required": [
            "from",
            "to"
          ],
          "type": "object"
        },
        "bodyType": {
          "enum": [
            "json",
            "form-data",
            "text"
          ],
          "type": "string"
        },
        "method": {
          "enum": [
            "POST"
          ],
          "type": "string"
        },
        "type": {
          "const": "http",
          "type": "string"
        }
      },
      "required": [
        "type",
        "method",
        "bodyType",
        "body"
      ],
      "type": "object"
    },
    "output": {
      "properties": {
        "example": {
          "properties": {
            "business_days": {
              "description": "Weekdays in [from, to) minus holidays (date inputs only)",
              "type": "integer"
            },
            "calendar": {
              "properties": {
                "days": {
                  "type": "integer"
                },
                "months": {
                  "type": "integer"
                },
                "years": {
                  "type": "integer"
                }
              },
              "required": [
                "years",
                "months",
                "days"
              ],
              "type": "object"
            },
            "direction": {
              "enum": [
                "forward",
                "backward"
              ],
              "type": "string"
            },
            "from": {
              "type": "string"
            },
            "iso_duration": {
              "example": "P1M15D",
              "type": "string"
            },
            "to": {
              "type": "string"
            },
            "total_days": {
              "type": "integer"
            },
            "total_hours": {
              "description": "Datetime inputs only",
              "type": "integer"
            },
            "total_minutes": {
              "type": "integer"
            },
            "total_seconds": {
              "type": "integer"
            },
            "total_weeks": {
              "type": "integer"
            }
          },
          "required": [
            "from",
            "to",
            "direction",
            "total_days",
            "total_weeks",
            "calendar",
            "iso_duration"
          ],
          "type": "object"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}

This page as JSON