invalid_date API Origin: Application & API Last updated 12 Oct 2026

API Error: Invalid date format — expected ISO 8601 (YYYY-MM-DDTHH:mm:ssZ)

A date or timestamp in the request isn’t in the format the API expects — usually ISO 8601 with a time zone, or a Unix timestamp.

Exact message you may see must match format "date-time"must match format "date"Invalid datetimeInput should be a valid datetimeInvalid date format
Seen on: REST API

Meaning

Dates are a classic source of 400/422 errors. Locale formats like 03/10/2026 are ambiguous, “2026-10-03 14:00” lacks the T separator and time zone, and some APIs want seconds since epoch while others want milliseconds or an RFC 3339 string.

Validators say things like “must match format "date-time"”, “Invalid datetime”, “Input should be a valid datetime” (Pydantic) or “Cannot deserialize value of type LocalDateTime” (Jackson).

Common causes

  • Locale-formatted string (dd/mm/yyyy, mm/dd/yyyy)
  • Missing T separator or time zone/offset
  • Milliseconds sent where the API expects seconds (or vice versa)
  • Date object serialized in a non-standard way
  • Invalid offset like +5:30 instead of +05:30

⚡ Quick fix

  1. Send ISO 8601/RFC 3339 strings in UTC: 2026-10-03T14:00:00Z
  2. Use toISOString() / isoformat() instead of formatting by hand
  3. Check whether the API wants seconds or milliseconds

Detailed fix by platform

Node.js

  1. javascript
    const body = { start: new Date(start).toISOString() };          // 2026-10-03T14:00:00.000Z
    const unix = Math.floor(Date.now() / 1000);                        // seconds, not ms

Python

  1. python
    from datetime import datetime, timezone
    datetime.now(timezone.utc).isoformat()   # '2026-10-03T14:00:00+00:00'

How to diagnose

  1. Raw value — Exact string sent
  2. Docs — ISO string, date-only, seconds or ms?
  3. Time zone — Present and well-formed?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

1048 — MySQL ERROR 1048 (23000): Column 'x' cannot be null (MySQL)10481264 — MySQL ERROR 1264 (22003): Out of range value for column 'x' at row 1 (MySQL)12641292 — MySQL ERROR 1292 (22007): Incorrect datetime value: 'x' for column 'y' (MySQL)12921366 — MySQL ERROR 1366 (HY000): Incorrect integer value: '' for column 'x' at row 1 (MySQL)13661406 — MySQL ERROR 1406: Data too long for column (MySQL)140622001 — ERROR: value too long for type character varying(255) (PostgreSQL)2200122008 — ERROR: date/time field value out of range: "31/12/2024" — HINT: Perhaps you need a different "datestyle" setting. (PostgreSQL)2200822P02 — ERROR: invalid input syntax for type integer: "abc" (PostgreSQL)22P02invalid_d…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.