Snipget.ai

Format a date or datetime

Exact
dates_format

Deterministic and authoritative — the canonical answer for this input.

Render an ISO 8601 datetime in a named preset (iso, date, time, datetime, us, eu, long, short, rfc2822) or a raw strftime pattern. Output is English/C-locale and host-independent. Processing multiple inputs? Use `dates_format_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

ISO 8601 datetime to render.

formatstringoptional

A named preset (iso, date, time, datetime, us, eu, long, short, rfc2822) or a raw strftime pattern.

Call it

curl -X POST https://api.snipget.ai/v1/dates/format \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"2024-03-15","format":"us"}'

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

Example response

{
  "input": "2024-03-15",
  "is_valid": true,
  "format": "us",
  "formatted": "03/15/2024"
}

FAQ

What does this do?

It takes a clean date and renders it in the style you want, such as US (03/15/2024), EU (15/03/2024), or a long form like March 15, 2024. Good for putting dates into emails, invoices, and reports.

What formats can I choose?

Named presets are iso, date, time, datetime, us, eu, long, short, and rfc2822. You can also pass your own strftime pattern for full control over the layout.

Will the month names match my language?

No. Output is always English and host-independent, so 'March' and 'Mon' come out the same everywhere. This tool does not localize to other languages.

Is the result exact?

Yes. Formatting is deterministic and authoritative. The same date and format always produce the same text.

What if I send a messy or invalid date?

The input must already be a clean ISO date or datetime. Messy text returns confidence 0 with a why_invalid reason. Parse it with the date parse tool first if needed.

Related tools