← All tool references

Date & Time · execute

Day Counter

Count the days and whole weeks between two dates, with a clear choice about including both endpoints.

Open public tool

Overview

Category
Date & Time
API mode
execute
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/day-counter

View this descriptor as JSON

Execute availability

This tool has an execute route defined by its descriptor. Server-side execution is currently unavailable, so requests return api_not_launched.

POST /api/v1/tools/day-counter/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

start_date · string · required
Choose the first date in the range.
end_date · string · required
Choose the last date in the range.
inclusive · boolean · required
Turn this on when both the start and end dates should be counted.
{
    "type": "object",
    "properties": {
        "start_date": {
            "type": "string",
            "description": "Choose the first date in the range."
        },
        "end_date": {
            "type": "string",
            "description": "Choose the last date in the range."
        },
        "inclusive": {
            "type": "boolean",
            "description": "Turn this on when both the start and end dates should be counted."
        }
    },
    "required": [
        "start_date",
        "end_date",
        "inclusive"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

days · number
Day count.
weekdays · number
Browser-calculated weekdays.
inclusive · boolean
Browser-calculated inclusive.
{
    "type": "object",
    "properties": {
        "days": {
            "type": "number",
            "description": "Day count."
        },
        "weekdays": {
            "type": "number",
            "description": "Browser-calculated weekdays."
        },
        "inclusive": {
            "type": "boolean",
            "description": "Browser-calculated inclusive."
        }
    },
    "additionalProperties": false
}

Day Counter: Inclusive span

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/day-counter/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "start_date": "2026-01-01",
    "end_date": "2026-01-03",
    "inclusive": true
}'
{
    "ok": true,
    "data": {
        "slug": "day-counter",
        "result": {
            "values": {
                "days": 3,
                "weekdays": 2,
                "inclusive": true
            },
            "display": {
                "display": "3"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.