Re: Is there away to output a time stamp in a specified time zone with the time zone indicator (e.g. EDT)

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there away to output a time stamp in a specified time zone with the time zone indicator (e.g. EDT)
Date: 2012-05-13 03:02:37
Message-ID: jon88d$fsm$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-05-02, Matrix Guy <matrixguy696(at)yahoo(dot)com> wrote:

>
> I'm referring to US time zones here.=A0 I'd like to output a time stamp field
> in a specified time zone.=A0 I'd also like to display the time zone
(e.g. EDT) at the end.=A0 Ideally,

trivially this is done by issuing set commands

set session timezone to 'america/new_york';
set session datestyle to 'sql,mdy';

select now();
05/12/2012 22:54:22.693175 EDT

select now() - interval '3 month' ;
02/12/2012 22:56:38.28168 EST

set session timezone to 'america/denver';
select now();
05/12/2012 21:00:13.998272 MDT

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2012-05-13 03:19:08 Re: Lock out PostgreSQL users for maintenance
Previous Message Frank Lanitz 2012-05-12 15:01:35 Re: Variables inside plpythonu