Re: what is the date format in binary query results

From: Gerald Timothy Quimpo <bopolissimus(dot)lists(at)gmail(dot)com>
To: Samantha Atkins <sjatkins(at)mac(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: what is the date format in binary query results
Date: 2007-12-13 06:36:55
Message-ID: 1197527815.16863.11.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2007-12-12 at 10:16 -0800, Samantha Atkins wrote:
> OK, I read it again. I don't see anything about how the timezone is
> specified for this type of column.

I went to the manual instead, see below for a useful section. Since
the "internally stored value is always in UTC", it doesn't need to
store a timezone in there. the internal timezone is always UTC.

When you read the contents of the timestamp with timezone column,
it converts it for you, either to the current timezone or a timezone
you specify.

====>

For timestamp with time zone, the internally stored value is always in
UTC (Universal Coordinated Time, traditionally known as Greenwich Mean
Time, GMT). An input value that has an explicit time zone specified is
converted to UTC using the appropriate offset for that time zone. If no
time zone is stated in the input string, then it is assumed to be in the
time zone indicated by the system's timezone parameter, and is converted
to UTC using the offset for the timezone zone.

When a timestamp with time zone value is output, it is always converted
from UTC to the current timezone zone, and displayed as local time in
that zone. To see the time in another time zone, either change timezone
or use the AT TIME ZONE construct (see Section 9.9.3).

Conversions between timestamp without time zone and timestamp with time
zone normally assume that the timestamp without time zone value should
be taken or given as timezone local time. A different zone reference can
be specified for the conversion using AT TIME ZONE.

http://www.postgresql.org/docs/8.2/interactive/datatype-datetime.html#DATATYPE-DATETIME-INTERNALS

<=====

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ken Johanson 2007-12-13 06:37:50 Re: RETURNING clause: how to specifiy column indexes?
Previous Message Gregory Stark 2007-12-13 06:27:44 Re: Slow PITR restore