Skip to content
Fourohtwo

Date Math

date-math.datemath.workers.dev/v1/time_buckets

Date Math: Split a time range into minute, hour, day, week, month, quarter or year buckets with exact start and end times in a time zone. DST-aware (23- and 25-hour days, repeated and skipped hours), ISO or Sunday/Saturday weeks, fiscal quarters, partial first and last buckets flagged or clipped. Up to 1,000 buckets. Use for chart axes, time-series grouping and filling empty periods in dashboards.

BaseUnchecked
POSThttps://date-math.datemath.workers.dev/v1/time_buckets

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://date-math.datemath.workers.dev/v1/time_buckets", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"bucket":"day","from":"2026-10-31","timezone":"America/New_York","to":"2026-11-03"}),
});
console.log(await res.json());

Example input

{
  "bucket": "day",
  "from": "2026-10-31",
  "timezone": "America/New_York",
  "to": "2026-11-03"
}

More from Date Math