{"uid":"cap_3QoH4UtQCUNUyyusoJSXu","slug":"date-math-timestamp-detection-utc-conversion-b22b6fca","name":"Date Math: Timestamp Detection & UTC Conversion","description":"Date Math: Detect and convert up to 100 mixed timestamps to UTC ISO 8601: Unix seconds/ms/µs/ns, Excel serial dates, Windows FILETIME, ISO 8601, RFC 2822, YYYY/MM/DD, month-name dates. Flags ambiguous values (03/04/2026: March 4 or 3 April? 45000: Excel date or Unix seconds?) with alternatives. Use for cleaning CSV, log and spreadsheet data.","url":"https://date-math.datemath.workers.dev/v1/timestamp?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"values":{"type":"array","items":{"type":["string","number"]},"maxItems":100,"minItems":1,"description":"Timestamps as strings or numbers. Pass very large integers (ns) as strings."},"timezone":{"type":"string","example":"Asia/Manila","description":"Zone for values without an offset and for the local output (default UTC)"},"date_order":{"enum":["MDY","DMY"],"type":"string","description":"How to read ambiguous slash dates like 03/04/2026 (default MDY, with the other reading in alternatives)"},"numeric_format":{"enum":["auto","unix_seconds","unix_ms","unix_us","unix_ns","excel","filetime"],"type":"string","default":"auto"}}},"responseSchema":{"type":"json","example":{"ok":4,"count":4,"results":[{"ok":true,"utc":"2025-11-07T07:20:00Z","input":1762500000,"local":"2025-11-07T15:20:00+08:00","format":"unix_seconds","unix_ms":1762500000000,"ambiguous":false,"alternatives":[],"unix_seconds":1762500000,"assumed_timezone":null}],"timezone":"Asia/Manila"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MvghiRWxOfgQwayGlrhHu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects and converts up to 100 mixed-format timestamps to UTC ISO 8601, flagging ambiguous values with alternative interpretations","exampleAgentPrompt":"I have a CSV export with a mix of Unix timestamps, Excel serial dates, and slash dates like 03/04/2026 — can you convert all of them to UTC ISO 8601? Treat ambiguous slash dates as day-first (DMY) and use Europe/London as the reference timezone.","exampleUseCases":[{"title":"Clean mixed-format log timestamps","prompt":"I have a server log with timestamps in all different formats — some are Unix seconds, some are ISO 8601, some look like Excel dates. Can you normalize all of them to UTC ISO 8601 so I can sort and analyze them? The server is in Asia/Manila timezone."},{"title":"Resolve ambiguous CSV date column","prompt":"My CSV has a date column with values like 03/04/2026 and 45000 and I'm not sure how to interpret them. Can you detect the formats and flag any ambiguous ones, treating slash dates as month-first (MDY)?"},{"title":"Spreadsheet Excel serial date conversion","prompt":"I exported an Excel sheet and the date column came out as numbers like 44927 and 45291 — can you convert those Excel serial dates to proper UTC ISO 8601 datetimes?"}],"resultDescription":"A JSON object with an ok count, total count, and a results array where each entry includes the UTC ISO 8601 datetime, local datetime in the requested timezone, detected format name, unix_seconds, unix_ms, an ambiguous boolean, and an alternatives array listing other plausible interpretations when the value is ambiguous.","failureModes":["Array exceeds 100 items — API rejects with validation error","Unrecognizable format returns ok:false for that individual entry","Very large nanosecond integers passed as numbers may lose precision — must be passed as strings","Invalid timezone string causes error or fallback to UTC","Empty values array rejected due to minItems:1 constraint"],"whenToPreferThis":"Choose this endpoint when you need to handle heterogeneous timestamp data from real-world sources (CSVs, logs, spreadsheets) that may mix Unix epoch variants, Excel serials, Windows FILETIME, and human-readable formats in the same dataset. It is especially valuable when ambiguity detection is important — e.g. distinguishing whether 45000 is an Excel date or Unix seconds, or whether 03/04 means March 4 or April 3. Prefer it over simple parsers when batch processing up to 100 values per call and when you need explicit alternative interpretations for ambiguous inputs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:36:24.191Z","isFirstParty":false,"canonicalSlug":"date-math-timestamp-detection-utc-conversion-b22b6fca"}