# Date Math – Calendar Info for a Date

> Date Math – Calendar Info for a Date is a paid API for AI agents from date-math.datemath.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-21).

Returns calendar facts for a given date: weekday name, ISO week/year, quarter, day-of-year, leap year status, weekend flag, days remaining, and Unix timestamp.

## Facts

- Endpoint: POST https://date-math.datemath.workers.dev/v1/info?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/date-math-calendar-info-for-a-date-8bd19285
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zJ5Al9LcC2wOxv0olrtcR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability date-math-calendar-info-for-a-date-8bd19285 -d '<json body>'
```

Example prompt: What day of the week is November 7, 2026, what quarter does it fall in, and is it a weekend? Also tell me the ISO week number and how many days are left in the year.

## When to prefer this

Use this endpoint when you need rich calendar metadata about a single date — weekday, ISO week, quarter, leap year, weekend status, and Unix timestamp — all in one call, rather than computing each separately. Prefer it over general-purpose date libraries when you need a lightweight, pay-per-call API with no setup.

## Known failure modes

- Invalid date format (not YYYY-MM-DD) returns a 400 or error response
- Out-of-range dates (e.g. month 13) return an error
- Missing 'date' field in request body returns an error
- Non-existent dates like February 30 return an error

## How this service works

Date Math: Calendar facts for a date: day of the week, ISO week number, quarter, day of year, leap year, weekend. Use for "what day is", week numbers and fiscal quarters.

## Output

A JSON object with the input date plus: weekday name and number, ISO week number and ISO year, calendar quarter (1–4), day of year, days remaining in year, days in year, days in month, is_weekend boolean, is_leap_year boolean, and Unix timestamp in seconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "type": "string",
   "example": "2026-11-07",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "date": "2026-11-07",
  "quarter": 4,
  "weekday": "Saturday",
  "iso_week": 45,
  "iso_year": 2026,
  "is_weekend": true,
  "day_of_year": 311,
  "days_in_year": 365,
  "is_leap_year": false,
  "unix_seconds": 1794009600,
  "days_in_month": 30,
  "weekday_number": 6,
  "days_remaining_in_year": 54
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/date-math-calendar-info-for-a-date-8bd19285/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from date-math.datemath.workers.dev](https://www.zero.xyz/host/date-math.datemath.workers.dev/llms.txt)
