Re: Timezone information - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: Timezone information
Date
Msg-id 20140219211932.GX29726@crankycanuck.ca
Whole thread Raw
In response to Re: Timezone information  (Dev Kumkar <devdas.kumkar@gmail.com>)
Responses Re: Timezone information  (Dev Kumkar <devdas.kumkar@gmail.com>)
List 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@crankycanuck.ca


pgsql-general by date:

Previous
From: Dev Kumkar
Date:
Subject: Re: Timezone information
Next
From: Dev Kumkar
Date:
Subject: Re: UTF-8 collation on Windows?