SQLSTATE 22008datetime_field_overflowHTTP 400
Postgres error 22008: datetime field overflow
date/time field value out of range
The text parsed but the value is impossible, such as month 13 or 30 February, or day and month were swapped.
Common causes
- A day-first date read with a month-first DateStyle (13/02/2026).
- Invalid dates generated by string concatenation.
How to fix it
- Use ISO 8601 dates.
- Build dates with make_date(year, month, day) or make_timestamptz instead of strings.
Through a REST API
PostgREST, the REST layer behind supabase-js and Scribase, answers HTTP 400 for this error and returns the SQLSTATE in the code field of the JSON error body.
Questions
What does Postgres error 22008 mean?
22008 is datetime_field_overflow in class 22 (Data Exception). The text parsed but the value is impossible, such as month 13 or 30 February, or day and month were swapped.
How do I fix 22008?
Use ISO 8601 dates. Build dates with make_date(year, month, day) or make_timestamptz instead of strings.
What HTTP status does a REST API return for 22008?
PostgREST, the REST layer behind supabase-js, answers 400.