Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqlg7-0002AJ-Ea for pgsql-general@arkaria.postgresql.org; Tue, 27 Feb 2018 20:16:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eqlg4-0008KN-Eo for pgsql-general@arkaria.postgresql.org; Tue, 27 Feb 2018 20:16:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqlg4-0008K8-1k for pgsql-general@lists.postgresql.org; Tue, 27 Feb 2018 20:16:44 +0000 Received: from mail-ot0-x232.google.com ([2607:f8b0:4003:c0f::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eqlg1-0003Cg-8G for pgsql-general@postgresql.org; Tue, 27 Feb 2018 20:16:43 +0000 Received: by mail-ot0-x232.google.com with SMTP id g97so73650otg.13 for ; Tue, 27 Feb 2018 12:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgsqlrocket-com.20150623.gappssmtp.com; s=20150623; h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=Smu5V71KMTrsmv3D6goaLlp9hcGWwoXA7gsoX114W1I=; b=mpjvQbs1jZP5FI2p5ma0KOnwxWTKOZt3f2FewwT5VJgPMlw2TxId8YTJrWtMj4AdIR 6gt8bQ+m+CyzaoPZSI+UTyw1d4PcgE6TYqWDG11GXSjuZe0WwJCOJPZIZnzC6mKAATHp mZaQFBP1eFI+iV+903nloQ839iW8YEbY4+EJp6tvM5STsdSQqVKN8HsHfGAngMrJo7hm 0AcVtEMqHMuz2BPFb0TbpzTkq0Edq9pJL8mymnrc0hP9sVgIJ1Urx6HNl62mQkAo3ODE ZxJj2duIT5q9uSHkN851w6f/xJc9MCkJZ6zawM/bxSzqqKLEhRuDp+PW/G6NiXet66MF gv3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=Smu5V71KMTrsmv3D6goaLlp9hcGWwoXA7gsoX114W1I=; b=f022sT8yUlnX3pN9QBUr4nrOD6PxG1uuke8LSadnJ7keLZzi0YNYj/Znx++KjTZFsg sUfqcA2ORImq91ikz1xlj3B7TwURkgCvRbFtNAkuYQc4WvpWxp5+cuNAZSelNO3npomG tnxTMK5hKPIPtzlew1ET819MUfCtoQLQrf4fOuEIXJfz+JkaWwWPt7WN+sHchlVjaqq0 oD3QATX78CkUdphXDfr11LE9zRmWnL43Be5hmmUlsiNU8GAn+JI7GrvpjrRZBL/njgTo Y7IeKyfXlnmcTInqnsDks3dFbr4LZ+1X+PV8tN9artqLsTqlSZAG4NRvjiM52RJe/FrU AXyQ== X-Gm-Message-State: APf1xPArtQlqjzUft1iTqqixnorBUIs1CNzClhORYuwUixwMDmXc9sSy J0laLOYGrUhlMp9SfRz4x6s35H/xzj8= X-Google-Smtp-Source: AG47ELuwJAhyLAuKMNkLK2eqK9p5EAtocN7za42O5DYFOcdwmemMRqweHT1x+jFuT26+kMYrZurLDw== X-Received: by 10.157.81.58 with SMTP id c55mr11864068oth.306.1519762599028; Tue, 27 Feb 2018 12:16:39 -0800 (PST) Received: from localhost.localdomain ([65.132.155.214]) by smtp.gmail.com with ESMTPSA id p19sm5611752ota.48.2018.02.27.12.16.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 12:16:38 -0800 (PST) Subject: selecting timestamp References: <0a80c0d7-3c90-3051-3835-8d973db8bdc4@pgsqlrocket.com> To: Postgres General From: chris X-Forwarded-Message-Id: <0a80c0d7-3c90-3051-3835-8d973db8bdc4@pgsqlrocket.com> Message-ID: <32ecec3a-654d-25e5-75ea-ccd7e2331429@pgsqlrocket.com> Date: Tue, 27 Feb 2018 13:16:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <0a80c0d7-3c90-3051-3835-8d973db8bdc4@pgsqlrocket.com> Content-Type: multipart/alternative; boundary="------------090A1D3C084E8C2B30708A18" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------090A1D3C084E8C2B30708A18 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 --------------090A1D3C084E8C2B30708A18 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
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
--------------090A1D3C084E8C2B30708A18--