Re: Timezone With Timestamp - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Timezone With Timestamp
Date
Msg-id Pine.LNX.4.44.0208201804000.5257-100000@cm-lcon1-46-187.cm.vtr.net
Whole thread Raw
In response to Timezone With Timestamp  (Gavin Roy <gmr@justsportsusa.com>)
Responses Re: Timezone With Timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Gavin Roy dijo:

> I know I'm missing something somewhere but I am using the data type
> timezone with timestamp and when I am retrieving the data while using
> the to_char function to format the timestamp, when I include the
> timezone ( to_char(t_timestamp, 'HH12:MM AM TZ') ) it is returning my
> local timezone and not the timezone of the record that inserted it.

Timestamps are stored in GMT and converted to the timezone the client is
currently in.

I think the easiest way to do what you want is to use timestamp without
time zone and store the timezone in a separate field.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"La realidad se compone de muchos sueños, todos ellos diferentes,
pero en cierto aspecto, parecidos..." (Yo, hablando de sueños eróticos)


pgsql-general by date:

Previous
From: Gavin Roy
Date:
Subject: Timezone With Timestamp
Next
From: "Arguile"
Date:
Subject: Re: Explain Output made Colourful