Skip to content
POST AI agent ready /v1/timestamp/convert

Unix Timestamp Converter API - Epoch to ISO 8601 & RFC

Convert a timestamp between Unix epoch (seconds or milliseconds), ISO 8601, and RFC 2822 formats. Send any recognized format and receive all three representations.

Parameters

stringrequired

The timestamp to convert. Accepts Unix epoch (number), ISO 8601 string, or RFC 2822 string.

string

Source format hint. One of: unix, unix_ms, iso, auto. Defaults to auto.

Code examples

curl -X POST https://api.botoi.com/v1/timestamp/convert \
  -H "Content-Type: application/json" \
  -d '{"timestamp":"1711434800","from":"auto"}'

When to use this API

Log timestamp normalization

Convert mixed timestamp formats from different services into a consistent ISO 8601 format for unified log aggregation.

User-facing date display

Convert Unix timestamps stored in your database to ISO 8601 strings before sending them to frontend date formatting libraries.

API debugging

Convert epoch timestamps from API responses to human-readable dates to quickly verify expiry times, event dates, or cache headers.

Frequently asked questions

Does this detect seconds vs. milliseconds automatically?
Yes. The API auto-detects whether a numeric timestamp is in seconds or milliseconds based on its magnitude.
What timezone is the ISO output in?
The ISO 8601 output is always in UTC (indicated by the Z suffix). Convert to local time on the client side.
Can I pass a human-readable date string?
The API accepts ISO 8601 and RFC 2822 strings. Free-form strings like "March 26, 2024" are not supported.
What is the relative field?
The relative field shows a human-readable duration like "2 hours ago" or "in 3 days," relative to the current server time.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.