PostgreSQL · sdk · fg-0273
node-postgres shifts DATE and TIMESTAMP values by the Node process timezone
A DATE of 2017-05-29 comes back as 2017-05-29T05:00:00.000Z in a process running at UTC-5
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
pg turns DATE and TIMESTAMP WITHOUT TIME ZONE values into JavaScript Date objects at local time in the Node process zone (the TZ variable), and formats Date parameters in that zone on the way in. Parsing DATE into a Date is kept only for backward compatibility.
Fix
Store instants as timestamptz, run Node with TZ=UTC, and keep DATE values as plain strings.
Apply
import pg from 'pg' pg.types.setTypeParser(1082, (v) => v) // DATE stays 'YYYY-MM-DD' // start the process with TZ=UTC
Affects: pg (node-postgres) 8.x, as of October 2026
Sources
- https://github.com/brianc/node-postgres/blob/master/docs/pages/features/types.mdx
- https://github.com/brianc/node-postgres/issues/783
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp