Re: Timezone With Timestamp

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Gavin Roy <gmr(at)justsportsusa(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Timezone With Timestamp
Date: 2002-08-20 22:05:26
Message-ID: Pine.LNX.4.44.0208201804000.5257-100000@cm-lcon1-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arguile 2002-08-21 00:45:51 Re: Explain Output made Colourful
Previous Message Aurangzeb M. Agha 2002-08-20 21:17:14 Re: Sun Pushing MySQL but Mentions PostgreSQL