Skip to content

Log timestamps

FREE with proof-of-workor $0.001 in USDCPOST /api/log-timestamps

Find 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.

Category: Time & schedulingTags: log timestamp parse iso8601 syslog epoch normalize utcAlso found as: log-time-parse timestamp-extract

Try in playground →

Parameters

NameTypeRequiredDescription
textstringyesLog text (at most 100,000 characters) Also accepted as content, str, string, input, body, data.
assumeZonestringnoIANA time zone for stamps that carry no zone or offset (default UTC)
yearnumbernoYear for syslog stamps, which carry none (default the current UTC year)
epochbooleannoRead 10- and 13-digit numbers as epoch seconds and milliseconds (default true)
limitnumbernoStamps 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

RequestPOST /api/log-timestamps
402$0.001 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example 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"
    }
  ]
}
FieldTypeAlways presentIn the example
assumedZonestringyesUTC
countnumberyes4
skippedInvalidnumberyes0
firststringyes2026-11-02T14:03:07.000Z
laststringyes2026-11-02T14:08:10.000Z
earlieststringyes2026-11-02T14:03:07.000Z
lateststringyes2026-11-02T14:08:10.000Z
spanSecondsnumberyes303
outOfOrdernumberyes0
largestGapobjectyes2 fields: seconds, endsAtLine
returnednumberyes4
matchednumberyes4
completebooleanyestrue
truncatedbooleanyesfalse
timestampsarray of objectsyes1 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

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

FREE w/ computeor $0.001POST /api/time-convert

Convert between epoch (s or ms), ISO 8601, and any IANA time zone.

Duration parse/humanize

FREE w/ computeor $0.001POST /api/duration

Parse a duration like "2h30m" / "1d4h" / "90s" to seconds, or humanize a number of seconds.

Current time

FREE w/ computeor $0.001GET /api/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

FREE w/ computeor $0.001POST /api/epoch-convert

Convert between Unix epoch timestamps and ISO 8601 date strings in both directions.

Date arithmetic

FREE w/ computeor $0.001POST /api/add-time

Add (or subtract) a duration to a date. duration like "2d", "-3h", "1w 2d", "90m".

Age calculator

FREE w/ computeor $0.001POST /api/age

Compute a precise age (years, months, days) from a birth date to today (or a given date), plus total days.