Snipget.ai

Validate an ISO 8601 date

Exact
dates_validate

Deterministic and authoritative — the canonical answer for this input.

Validate whether a string is a real ISO 8601 date or datetime. Returns is_valid, the normalized form, whether it carries a time and a timezone, and why-not on failure. Processing multiple inputs? Use `dates_validate_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

The string to check as an ISO 8601 date/datetime.

Call it

curl -X POST https://api.snipget.ai/v1/dates/validate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"2024-03-15T14:30:00Z"}'

The Batch tab sends up to 1000 inputs in one call via /v1/dates/validate/batch.

Example response

{
  "input": "2024-03-15T14:30:00Z",
  "is_valid": true,
  "normalized": "2024-03-15T14:30:00+00:00",
  "has_time": true,
  "has_timezone": true
}

FAQ

What does validate check?

Whether a string is a real ISO 8601 date or datetime, like 2024-03-15 or 2024-03-15T14:30:00Z. It also tells you whether the value includes a time and a timezone, and returns a normalized version.

Why use it before saving dates?

It catches bad dates, such as 2024-13-40 or free text, before they get into your spreadsheet or database. That prevents broken records and sorting problems down the line.

Is the check exact?

Yes. It is deterministic and authoritative. A given string is either valid ISO 8601 or it is not.

Does it accept any date format?

No. It only accepts strict ISO 8601 (year-month-day). For messy human formats like '3/15/24' or 'March 15, 2024', use the date parse tool instead, which is best-effort.

What does an invalid date return?

A normal result with is_valid false, confidence 0, and a why_invalid reason explaining the problem. It does not raise an error, so you can read the reason and fix the input.

Related tools