Search Postgresql Archives

timestamp with time zone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux