# agent402.tools Relative Time Formatter

> agent402.tools Relative Time Formatter is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Converts a timestamp into a human-readable relative phrase (e.g. '3 hours ago', 'in 2 days') relative to now or a specified reference time.

## Facts

- Endpoint: POST https://agent402.tools/api/relative-time
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-relative-time-formatter-5cf115ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kRnnT1JuiVecgxA083p9-

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 agent402-tools-relative-time-formatter-5cf115ca -d '<json body>'
```

Example prompt: Can you turn the timestamp '2024-11-01T08:30:00Z' into a human-friendly relative phrase like '3 days ago' or 'in 2 hours', using right now as the reference point?

## When to prefer this

Use this endpoint when you need to display timestamps in a natural, human-friendly format for end users, dashboards, notifications, or logs — especially when the relative phrasing (e.g. '2 hours ago') is more meaningful than the absolute time. Prefer it over manual date arithmetic when you need consistent, readable output without building your own formatting logic.

## Known failure modes

- Invalid or unparseable timestamp format returns an error
- Missing required 'time' field causes a validation error
- Reference time ('from') in an unrecognized format returns an error
- Extremely distant timestamps (e.g. year 9999) may return unexpected results

## How this service works

Format a timestamp as a human relative phrase ("3 hours ago", "in 2 days") versus now or a reference time.

## Output

A human-readable relative time phrase such as '3 hours ago', 'in 2 days', or 'just now', computed from the target timestamp relative to now or a provided reference time.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "from": {
   "description": "Reference (default now)"
  },
  "time": {
   "description": "Target timestamp"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "3 hours ago",
  "seconds": -10800
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-relative-time-formatter-5cf115ca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
