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
- Send ISO 8601 strings
- Use to_date('31/12/2024', 'DD/MM/YYYY')
Detailed fix by platform
PostgreSQL
SELECT to_date('31/12/2024', 'DD/MM/YYYY');
How to diagnose
- Input — Format?
- 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:
Similar errors
Most viewed in PostgreSQL
- could not connect PostgreSQL: could not connect to server / connection refused — Is the server running on host and accepting TCP/IP connections?
- pg_restore text dump pg_restore: error: input file appears to be a text format dump. Please use psql.
- 25P02 ERROR: current transaction is aborted, commands ignored until end of transaction block
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 15 Oct 2026