selecting timestamp

From: chris <chrisk(at)pgsqlrocket(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: selecting timestamp
Date: 2018-02-27 20:16:37
Message-ID: 32ecec3a-654d-25e5-75ea-ccd7e2331429@pgsqlrocket.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


What is the best way of selecting current timestamp in UTC?

SELECT
CURRENT_TIMESTAMP   as ct1
,timezone('UTC',CURRENT_TIMESTAMP) as ct2
,timezone('utc',now()) as ct3
,CURRENT_TIMESTAMP at time zone 'UTC' as ct4
,NOW() at time zone 'utc' as ct5

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-02-27 20:25:20 Re: selecting timestamp
Previous Message Tom Kazimiers 2018-02-27 20:08:30 Re: Unexpected behavior with transition tables in update statement trigger