‹ BackHN Continuity

Thread

Footguns with Postgres “at time zone 'UTC'”

169 points · 114 comments · birdculture

  1. ekjhgkejhgk · · focus · HN ↗
    > Adding a month with + INTERVAL '1 months' is timezone-dependent. If your product operates in UTC, you must ensure the timezone is in UTC before adding a month with <timestamptz_column> AT TIME ZONE 'UTC' + INTERVAL '1 months'.... but now the result is a timestamp, not a timestamptz.

    Different take. Maybe the mistake is believing you can add "1 month" to anything and expecting your intuition to be worth anything.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.