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

**Code:** `22008` · **Category:** PostgreSQL · **Seen on:** PostgreSQL

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

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/postgresql/date-time-field-value-out-of-range)
