Re: Timezone information

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Timezone information
Date: 2014-02-19 21:19:32
Message-ID: 20140219211932.GX29726@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 20, 2014 at 02:46:46AM +0530, Dev Kumkar wrote:
> Since the database is created on SRC-INDIA the timezone parameter gets set
> as "Asia/Calcutta", but when shipped locally then now() would return
> incorrect time as per target TGT-USA local time.
>

No, select now() would return the time in whatever timezone is set, or
the timezone that the server defaulted to if there's nothing set by
the client. So in your installation, set up the server to use UTC by
default and, if you like, set the client's time zone according to
locale or whatever when the client connects.

The timestamps in the server are not actually "in" a time zone.
They're all stored as UTC, and the display is altered according to
what your time zone settings are at the time of query.

Best regards,

A

--
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dev Kumkar 2014-02-19 21:21:00 Re: UTF-8 collation on Windows?
Previous Message Dev Kumkar 2014-02-19 21:16:46 Re: Timezone information