Re: Set default time zone for displaying dates in a session

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Set default time zone for displaying dates in a session
Date: 2011-01-29 03:32:27
Message-ID: ii01ob$dad$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 2011-01-28, Basil Bourque <basil(dot)list(at)me(dot)com> wrote:

> Is there a way to set a different time zone as the default for a session?

> By default, Postgres displays my data stored in "TIMESTAMP WITH TIME
> ZONE" columns' data as a local time for the time zone of the computer
> hosting the Postgres cluster.
>
> If my Postgres server is in Seattle, but my user is in New York, I
> want the times shown in New York time zone.

-- once per session.
SET TIMEZONE TO 'America/New_York';

-- or once only
ALTER USER username SET TIMEZONE TO 'America/New_York';

or you can do the whole database with ALTER DATABASE.

--
⚂⚃ 100% natural

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Leon Starr 2011-01-29 05:59:15 How to 'print a table' in the middle of a plpgsql function
Previous Message ljochoa3@cantv.net 2011-01-28 18:39:45 ljochoa3@cantv.net