# Basic Utils Agent – Datetime Difference

> Basic Utils Agent – Datetime Difference is a paid API for AI agents from basic-utils-agent.up.railway.app, paid per call via x402, $0.0015/call, status unknown (last checked 2026-09-14).

Calculates the number of days between two datetime values

## Facts

- Endpoint: POST https://basic-utils-agent.up.railway.app/datetime/difference
- Price: $0.0015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/basic-utils-agent-datetime-difference-6c3f13c2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_j2vTrpQbKJKJFDdJVgRmd

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 basic-utils-agent-datetime-difference-6c3f13c2 -d '<json body>'
```

Example prompt: How many days are there between January 15, 2024 and March 22, 2024?

## When to prefer this

Choose this endpoint when you need a simple, fast computation of the number of days between two datetimes. It is ideal for countdown timers, tenure calculations, scheduling gaps, and any scenario requiring a numeric day-count difference. Prefer this over general-purpose LLM date math when you need a deterministic, reliable integer result without rounding ambiguity.

## Known failure modes

- Missing date or date2 fields returns an error or null result
- Malformed datetime strings (non-ISO 8601 format) cause parsing errors
- Swapped date order may return a negative difference
- Timezone inconsistencies between inputs may cause off-by-one errors

## How this service works

A versatile utility agent offering calculator, statistics, datetime, and unit conversion services.

## Output

Returns a JSON object with a single integer field 'difference' representing the number of days between the two provided datetime values (e.g. {"difference": 7}).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "anyOf": [
    {
     "type": "string",
     "format": "date-time"
    },
    {
     "type": "null"
    }
   ],
   "default": null,
   "description": "The base date for the operation (required for add, subtract, difference, and day-of-week operations)"
  },
  "days": {
   "anyOf": [
    {
     "type": "integer"
    },
    {
     "type": "null"
    }
   ],
   "default": null,
   "description": "Number of days to add or subtract from the date (required for add and subtract operations)"
  },
  "date2": {
   "anyOf": [
    {
     "type": "string",
     "format": "date-time"
    },
    {
     "type": "null"
    }
   ],
   "default": null,
   "description": "The second date for difference calculation (required for difference operation)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "difference": 7
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/basic-utils-agent-datetime-difference-6c3f13c2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from basic-utils-agent.up.railway.app](https://www.zero.xyz/host/basic-utils-agent.up.railway.app/llms.txt)
