ISO date range split by month
iso-date-range-split-by-month · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed
Split an inclusive [start, end] date range into per-calendar-month sub-ranges.
Use when you need to: iso date range split by month · chunk date range by calendar month · monthly billing periods from range.
Supported
- iso date range split by month
- chunk date range by calendar month
- monthly billing periods from range
Not supported
- fiscal months
- split by week or quarter
- timezones
Behavior
- start and end are strict YYYY-MM-DD calendar dates with year 0001-9999. start must not be after end.
- The range is split into at most 1200 consecutive sub-ranges, one per calendar month it touches.
- The first sub-range starts at start (not necessarily the 1st). The last sub-range ends at end (not necessarily the month end). Every sub-range in between spans a full calendar month.
- Sub-ranges are contiguous and in ascending order; their union covers exactly [start, end] with no gaps or overlaps.
Input
start(string, required): min length 10; max length 10; pattern^\d{4}-\d{2}-\d{2}$end(string, required): min length 10; max length 10; pattern^\d{4}-\d{2}-\d{2}$
Output
ranges(array of object, required)
Limits
- year min: 1
- year max: 9999
- max segments: 1200
Example
Request input:
{
"start": "2026-01-20",
"end": "2026-03-10"
}
Response:
{
"result": {
"ranges": [
{
"start": "2026-01-20",
"end": "2026-01-31"
},
{
"start": "2026-02-01",
"end": "2026-02-28"
},
{
"start": "2026-03-01",
"end": "2026-03-10"
}
]
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "iso-date-range-split-by-month",
"version": "1.0.0",
"input": {
"start": "2026-01-20",
"end": "2026-03-10"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/iso-date-range-split-by-month/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"start":"2026-01-20","end":"2026-03-10"}'
The machine-readable contract is at /v1/tools/iso-date-range-split-by-month/versions/1.0.0.
CLI
node cli.mjs run iso-date-range-split-by-month 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- ISO date add months: Add a signed month count to a YYYY-MM-DD date, clamping the day to the target month.
- ISO date add years: Add a signed whole-year delta to a YYYY-MM-DD date, clamping the day if 29 February has no match.
- ISO date days in month: Return the number of calendar days in a given proleptic Gregorian year and month.
- ISO date month end: Return the last valid calendar day of the year-month of a YYYY-MM-DD date.
- ISO date month start: Return the first calendar day of the year-month of a YYYY-MM-DD date.
- ISO date range union: Merge overlapping or day-adjacent inclusive [start, end] date ranges into the fewest equivalent ranges.