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.
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 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026