22008 PostgreSQL Origin: Data Last updated 15 Oct 2026

ERROR: date/time field value out of range: "31/12/2024" — HINT: Perhaps you need a different "datestyle" setting.

PostgreSQL parsed a date in the wrong order (DMY vs MDY) or got an impossible value.

Exact message you may see date/time field value out of rangePerhaps you need a different "datestyle" setting
Seen on: PostgreSQL

Meaning

Ambiguous formats depend on the DateStyle setting. ISO 8601 (YYYY-MM-DD) always works.

Common causes

  • DD/MM/YYYY input with MDY DateStyle
  • Invalid dates (Feb 30)
  • Locale-formatted strings

⚡ Quick fix

  1. Send ISO 8601 strings
  2. Use to_date('31/12/2024', 'DD/MM/YYYY')

Detailed fix by platform

PostgreSQL

  1. SELECT to_date('31/12/2024', 'DD/MM/YYYY');

How to diagnose

  1. Input — Format?
  2. DateStyle — SHOW datestyle

🔧 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: Data. Errors that are often confused with or caused by this one (click to open):

1292 — MySQL ERROR 1292 (22007): Incorrect datetime value: 'x' for column 'y' (MySQL)12921690 — MySQL ERROR 1690 (22003): BIGINT UNSIGNED value is out of range (MySQL)169022001 — ERROR: value too long for type character varying(255) (PostgreSQL)2200122003 — ERROR: numeric field overflow — A field with precision 5, scale 2 must round to an absolute value less than 10^3 (PostgreSQL)2200322P02 — ERROR: invalid input syntax for type integer: "abc" (PostgreSQL)22P0222P02 uuid — ERROR: invalid input syntax for type uuid: "x" (PostgreSQL)22P02 uuid42804 — ERROR: column "x" is of type integer but expression is of type text — HINT: You will need to rewrite or cast the expression. (PostgreSQL)4280442883 operator — ERROR: operator does not exist: integer = text (PostgreSQL)42883 operator22008

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.