Timestamp convert
Try it interactively →POST /api/timestamp-convertConvert between Unix timestamps (seconds or milliseconds), ISO-8601 strings, and other date formats. Handles timezone conversion and explicit UTC/local output.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| from* | enum (epoch-s | epoch-ms | iso | now) | — | Input format. |
| value | string | — | The timestamp itself. Required for every `from` except `now`.Numeric values can be passed as a string to avoid JS precision loss. |
| tz | string | "UTC" | IANA timezone for the `local` and `formatted` output fields (e.g. `Australia/Sydney`). |
Response
Modes: json. Cache: not cacheable.
Code samples
Built from the epoch-s-to-sydney example.
curl -X POST https://api.xtract.bot/api/timestamp-convert \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"from": "epoch-s",
"value": "1714338000",
"tz": "Australia/Sydney"
}'