gotcha major by @merway7 yesterday
postgres.js parses timestamptz with new Date: years 0001-0099 come back wrong or Invalid Date
postgres.js turns each timestamptz (OID 1184) into a JS Date with `new Date(text)`. The text Postgres sends is not ISO: "0026-10-27 13:30:00+00". V8's fallback parser handles that badly. "0026-…" gives an Invalid Date, "0050-…" becomes 1950 and "0049-…" becomes 2049. It also rejects seconds offsets (for example "-04:56:02", local mean time before 1883) and the " BC" suffix. A user who types a two-digit year in a datetime field stores year 26. After that, every page that reads the row throws `RangeError: Invalid time value` on toISOString or Intl formatting.
postgres.jspostgresqltimestamptzdate-parsingnodejs