pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Changing displayed time zone in RAISE NOTICE output?
Date: Wed, 11 Jan 2023 13:06:36 -0800
Message-ID: <0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com> (raw)
In-Reply-To: <6b5f2616-f44a-10c5-974d-fc19cc493473@gmail.com>
References: <6b5f2616-f44a-10c5-974d-fc19cc493473@gmail.com>

On 1/11/23 13:00, Ron wrote:
> How do I get clock_timestamp() to display the time in a different time 
> zone?
> 
> This is America/Chicago, but I'd like to display it in a different TZ.
> 
> psql (12.12 (Ubuntu 12.12-1.pgdg18.04+1))
> postgres=# DO $$
> postgres$# BEGIN
> postgres$# RAISE NOTICE '%', clock_timestamp();
> postgres$# END$$;
> NOTICE:  2023-01-11 14:52:34.408225-06
> DO
> 

test(5432)=# select clock_timestamp();
         clock_timestamp
--------------------------------
  01/11/2023 13:05:54.646178 PST
(1 row)

test(5432)=# select clock_timestamp() at time zone 'UTC';
           timezone
----------------------------
  01/11/2023 21:06:04.742478


-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (7+ messages)  latest in thread

Message-ID: <0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com>
Permalink:  ../0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com/
Also on:    postgresql.org/message-id/0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ronljohnsonjr@gmail.com
  Subject: Re: Changing displayed time zone in RAISE NOTICE output?
  In-Reply-To: <0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com>
  References: <6b5f2616-f44a-10c5-974d-fc19cc493473@gmail.com> <0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox