Format a concise time range
Free during preview · test keys only
Request
start=10:00end=11:00
Result · Shared am/pm
10 - 11am
Turn two times into a compact English label: 10 - 11am, 1:30 - 6:15pm, or 10am - 12pm. The 12-hour clock drops leading zeros and :00 minutes. Equal times at hour:minute collapse to one label, such as 1:30pm; seconds are ignored for display and ordering.
Datetimes normalize to UTC. Returned start and end use RFC 3339 with Z at whole-second precision. Two clock-only inputs use 1970-01-01 UTC; a single clock borrows the dated side’s UTC date. Leap seconds are not supported.
Different UTC dates prefix each side with month and day, without a year: Oct 13, 10pm - Oct 14, 2am. Use dated inputs for overnight ranges; an earlier end is refused. Scoped test keys must allow dates.range. No balance or payment is required.
Parameters
- Name
start- Type
- string · query
- Required
- Required
- Description
- RFC 3339 datetime with an offset, or HH:MM[:SS] in UTC.
- Name
end- Type
- string · query
- Required
- Required
- Description
- Same formats as start. Must not precede start at minute precision.
- Name
locale- Type
- string · query
- Required
- Optional
- Default
- Default
"en" - Description
- English only. Other values return unsupported_locale.
- Name
separator- Type
- string · query
- Required
- Optional
- Default
- Default
" - " - Description
- Literal text between the times. Whitespace and empty strings are preserved.
Make a call
curl --request GET 'https://api.butter.pub/v1/dates/range?start=10%3A00&end=11%3A00&locale=en&separator=%20-%20' \
--header "Authorization: Bearer $APIBUTTER_TEST_KEY"use Illuminate\Support\Facades\Http;
$response = Http::withToken($key)
->get('https://api.butter.pub/v1/dates/range', ['start' => '10:00', 'end' => '11:00', 'locale' => 'en', 'separator' => ' - ']);
$result = $response->throw()->json();const url = new URL('https://api.butter.pub/v1/dates/range');
url.search = new URLSearchParams({
"start": "10:00",
"end": "11:00",
"locale": "en",
"separator": " - "
}).toString();
const response = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${key}` },
});
if (!response.ok) throw await response.json();
const result = await response.json(); Use your test key as $APIBUTTER_TEST_KEY or key. Keep it out of source control.
Or ask your agent
Call dates_range on the authenticated MCP server at https://mcp.butter.pub/mcp.
Tool errors carry the same problem in structured content and JSON text, with isError: true.
{
"name": "dates_range",
"arguments": {
"start": "10:00",
"end": "11:00",
"locale": "en",
"separator": " - "
}
}Responses
200The concise label and normalized UTC inputs. Nothing is charged. · application/json
- Name
object- Type
- string · always "time_range"
- Required
- Required
- Name
text- Type
- string
- Required
- Required
- Name
start- Type
- string · date-time
- Required
- Required
- Name
end- Type
- string · date-time
- Required
- Required
- Name
locale- Type
- string · always "en"
- Required
- Required
{
"object": "time_range",
"text": "10 - 11am",
"start": "1970-01-01T10:00:00Z",
"end": "1970-01-01T11:00:00Z",
"locale": "en"
}{
"object": "time_range",
"text": "10am - 12pm",
"start": "1970-01-01T10:00:00Z",
"end": "1970-01-01T12:00:00Z",
"locale": "en"
}{
"object": "time_range",
"text": "1:30 - 6:15pm",
"start": "1970-01-01T13:30:00Z",
"end": "1970-01-01T18:15:00Z",
"locale": "en"
}{
"object": "time_range",
"text": "1:30pm",
"start": "1970-01-01T13:30:00Z",
"end": "1970-01-01T13:30:00Z",
"locale": "en"
}{
"object": "time_range",
"text": "Oct 13, 10pm - Oct 14, 2am",
"start": "2026-10-13T22:00:00Z",
"end": "2026-10-14T02:00:00Z",
"locale": "en"
}401Missing, invalid, or revoked bearer key.1 example
application/problem+json
{
"type": "https://apibutter.com/docs/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "A valid, unrevoked bearer API key is required.",
"code": "unauthorized",
"param": null,
"errors": null,
"request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}403Live keys are refused during preview; scoped test keys must allow dates.range.2 examples
application/problem+json
{
"type": "https://apibutter.com/docs/errors/test_keys_only",
"title": "Forbidden",
"status": 403,
"detail": "This operation is free during preview and accepts abk_test_ keys only.",
"code": "test_keys_only",
"param": null,
"errors": null,
"request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}{
"type": "https://apibutter.com/docs/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "The API key does not allow this operation.",
"code": "forbidden",
"param": null,
"errors": null,
"request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}422Invalid input. The detail names the parameter to correct.3 examples
application/problem+json
{
"type": "https://apibutter.com/docs/errors/end_before_start",
"title": "Unprocessable Content",
"status": 422,
"detail": "The end parameter must not precede start at minute precision.",
"code": "end_before_start",
"param": "end",
"errors": {
"end": [
"The end parameter must not precede start at minute precision."
]
},
"request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}{
"type": "https://apibutter.com/docs/errors/invalid_parameter",
"title": "Unprocessable Content",
"status": 422,
"detail": "The start parameter must be a valid RFC 3339 datetime or HH:MM[:SS].",
"code": "invalid_parameter",
"param": "start",
"errors": {
"start": [
"The start parameter must be a valid RFC 3339 datetime or HH:MM[:SS]."
]
},
"request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}{
"type": "https://apibutter.com/docs/errors/unsupported_locale",
"title": "Unprocessable Content",
"status": 422,
"detail": "The locale parameter supports en only.",
"code": "unsupported_locale",
"param": "locale",
"errors": {
"locale": [
"The locale parameter supports en only."
]
},
"request_id": "req_01jbz8c6m3x4v9t2q7w5n8r0ka"
}When a call fails
| Code | Status | Meaning |
|---|---|---|
| unauthorized | 401 | A valid, unrevoked bearer API key is required. |
| test_keys_only | 403 | This operation is free during preview and accepts abk_test_ keys only. |
| forbidden | 403 | The API key does not allow this operation. |
| end_before_start | 422 | The end parameter must not precede start at minute precision. |
| invalid_parameter | 422 | The start parameter must be a valid RFC 3339 datetime or HH:MM[:SS]. |
| unsupported_locale | 422 | The locale parameter supports en only. |