Log timestamps
POST /api/log-timestampsFind each timestamp in the formats below in log text and write each as ISO 8601 UTC, with its line, column and character span in the original. Send POST /api/log-timestamps with the required field text and pay $0.001 per call over x402 or MPP, or call it free by solving a proof-of-work challenge. It returns a JSON object with assumedZone, count, skippedInvalid, first, last and 10 more.
Reads ISO 8601, RFC 2822, syslog, Apache and nginx access-log stamps, and epoch seconds or milliseconds (2000 to 2100). Stamps without a zone are read in assumeZone (an IANA name, default UTC); syslog stamps carry no year and take year (default the current UTC year). Also reports the first and last stamp, the span, stamps out of order and the largest gap. Text up to 100,000 characters (in a request body of at most 100 KB; JSON escaping counts, so a newline takes two bytes); up to 2,000 stamps listed.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text | string | yes | Log text (at most 100,000 characters) Also accepted as content, str, string, input, body, data. |
assumeZone | string | no | IANA time zone for stamps that carry no zone or offset (default UTC) |
year | number | no | Year for syslog stamps, which carry none (default the current UTC year) |
epoch | boolean | no | Read 10- and 13-digit numbers as epoch seconds and milliseconds (default true) |
limit | number | no | Stamps to list, 1-2000 (default 500); the summary counts every stamp |
Example request
curl -i -X POST https://agent402.tools/api/log-timestamps \
-H "Content-Type: application/json" \
-d '{"text":"2026-11-02T14:03:07Z service started\nNov 2 14:05:11 host sshd[311]: accepted\n10.0.0.5 - - [02/Nov/2026:14:06:40 +0000] \"GET / HTTP/1.1\" 200\njob done at 1793628490","assumeZone":"UTC","year":2026}'Without payment this returns HTTP 402 Payment Required with the exact price for log-timestamps; any x402 v2 or MPP client pays it and retries.
Watch a call get paid
POST /api/log-timestamps$0.001 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"assumedZone": "UTC",
"count": 4,
"skippedInvalid": 0,
"first": "2026-11-02T14:03:07.000Z",
"last": "2026-11-02T14:08:10.000Z",
"earliest": "2026-11-02T14:03:07.000Z",
"latest": "2026-11-02T14:08:10.000Z",
"spanSeconds": 303,
"outOfOrder": 0,
"largestGap": {
"seconds": 124,
"endsAtLine": 2
},
"returned": 4,
"matched": 4,
"complete": true,
"truncated": false,
"timestamps": [
{
"line": 1,
"column": 1,
"start": 0,
"end": 20,
"text": "2026-11-02T14:03:07Z",
"format": "iso8601",
"iso": "2026-11-02T14:03:07.000Z",
"epochMs": 1793628187000,
"zone": "stamp"
}
]
}| Field | Type | Always present | In the example |
|---|---|---|---|
assumedZone | string | yes | UTC |
count | number | yes | 4 |
skippedInvalid | number | yes | 0 |
first | string | yes | 2026-11-02T14:03:07.000Z |
last | string | yes | 2026-11-02T14:08:10.000Z |
earliest | string | yes | 2026-11-02T14:03:07.000Z |
latest | string | yes | 2026-11-02T14:08:10.000Z |
spanSeconds | number | yes | 303 |
outOfOrder | number | yes | 0 |
largestGap | object | yes | 2 fields: seconds, endsAtLine |
returned | number | yes | 4 |
matched | number | yes | 4 |
complete | boolean | yes | true |
truncated | boolean | yes | false |
timestamps | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "log-timestamps",
"params": {
"text": "2026-11-02T14:03:07Z service started\nNov 2 14:05:11 host sshd[311]: accepted\n10.0.0.5 - - [02/Nov/2026:14:06:40 +0000] \"GET / HTTP/1.1\" 200\njob done at 1793628490",
"assumeZone": "UTC",
"year": 2026
}
}On the hosted connector at https://agent402.tools/mcp, catalog.call runs log-timestamps free (rate-limited, no wallet). Local install: npx -y agent402-mcp@0.15.0.
Errors and behavior
textis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. Some calls are paid before they run; a failed one can be retried free with the same payment, or is refunded. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Free tier: no outbound network call leaves the server for this tool, so proof-of-work (16 leading zero bits of sha256) pays for it.
- A
GETorHEADto /api/log-timestamps returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/log-timestamps", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"text": "2026-11-02T14:03:07Z service started\nNov 2 14:05:11 host sshd[311]: accepted\n10.0.0.5 - - [02/Nov/2026:14:06:40 +0000] \"GET / HTTP/1.1\" 200\njob done at 1793628490",
"assumeZone": "UTC",
"year": 2026
}),
});No wallet? Pay with compute
Fetch a challenge, solve the sha256 puzzle (16 leading zero bits, a fraction of a second of CPU), and resend with the X-Pow-Solution header:
import { createHash } from "node:crypto";
const lz = (b) => { let t = 0; for (const x of b) { if (!x) { t += 8; continue; } t += Math.clz32(x) - 24; break; } return t; };
const c = await (await fetch("https://agent402.tools/api/pow/challenge?slug=log-timestamps")).json();
let n = 0;
while (lz(createHash("sha256").update(c.challenge + ":" + n).digest()) < c.difficulty) n++;
await fetch("https://agent402.tools/api/log-timestamps", { method: "POST", headers: { "X-Pow-Solution": c.token + ":" + n, "Content-Type": "application/json" }, body: JSON.stringify({"text":"2026-11-02T14:03:07Z service started\nNov 2 14:05:11 host sshd[311]: accepted\n10.0.0.5 - - [02/Nov/2026:14:06:40 +0000] \"GET / HTTP/1.1\" 200\njob done at 1793628490","assumeZone":"UTC","year":2026}) });Related tools
Time convert
Convert between epoch (s or ms), ISO 8601, and any IANA time zone.
Duration parse/humanize
Parse a duration like "2h30m" / "1d4h" / "90s" to seconds, or humanize a number of seconds.
Current time
Current time: UTC ISO, epoch seconds/ms, day of week/year, ISO week - optionally rendered in any IANA timezone via ?tz=.
Epoch / ISO converter
Convert between Unix epoch timestamps and ISO 8601 date strings in both directions.
Date arithmetic
Add (or subtract) a duration to a date. duration like "2d", "-3h", "1w 2d", "90m".
Age calculator
Compute a precise age (years, months, days) from a birth date to today (or a given date), plus total days.