timestamp with time zone

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: pgsql-general(at)postgresql(dot)org
Subject: timestamp with time zone
Date: 2007-12-13 05:10:45
Message-ID: 20071213.141045.51691404.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Can someone enlighten me?

I know that I can insert date/time data along with time zone info into
the timestamp with time zone data type. My question is, can I extract
the *original* time zone info afterward? I seems impossible.

May be I should use date + time with time zone to preserve the time
zone info?

It seems the time with time zone data type can do this.

test=# create table t2(t time with time zone);
CREATE TABLE
test=#
test=# insert into t2 values('12:34:56 +0400');
INSERT 0 1
test=# select * from t2;
t
-------------
12:34:56+04
(1 row)

test=# select t at time zone 'jst' from t2;
timezone
-------------
17:34:56+09
(1 row)

test=# select t::time from t2;
t
----------
12:34:56
(1 row)
--
Tatsuo Ishii
SRA OSS, Inc. Japan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2007-12-13 05:12:42 timestamp with time zone
Previous Message John D. Burger 2007-12-13 04:48:06 Re: Need LIMIT and ORDER BY for UPDATE