PostgreSQL date() with timezone

前端 未结 4 615
无人共我
无人共我 2020-12-23 07:01

I\'m having an issue selecting dates properly from Postgres - they are being stored in UTC, but not converting with the Date() function properly.

Converting the tim

4条回答
  •  梦毁少年i
    2020-12-23 07:33

    I know this is an old one but You may want to consider using AT TIME ZONE "US/Pacific" when casting to avoid any PST/PDT issues. So

    SELECT starts_at::TIMESTAMPTZ AT TIME ZONE "US/Pacific" 
      FROM schedules 
     WHERE ID = '40';
    

提交回复
热议问题