Timezone With Timestamp

From: Gavin Roy <gmr(at)justsportsusa(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Timezone With Timestamp
Date: 2002-08-20 20:55:59
Message-ID: 3AB8C9F2-B47F-11D6-BC43-00039350FEEA@justsportsusa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

For example when the data is being inserted from east coast our system
does a:

SET TIMEZONE = 'America/New_York' ;

then INSERT INTO table VALUES ( now() );

(abbreviated for explanation)

Anyway what I want to return in one query is the time in/and the
timezone such as

10:15 AM EST
10:30 AM PST
11:25 PM CST
12:00 PM GMT

Can someone give me a pointer as to what direction to poke in, or is
this even possible?

TIA,

Gavin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lane Stevens 2002-08-20 21:05:49 %ROWTYPE in PL/PgSQL
Previous Message elein 2002-08-20 20:36:52 Table Inheritance