Search Postgresql Archives

Re: time without time zone

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

 



Garry Saddington wrote:
This is a select on table periods defined as such:
CREATE TABLE periods
(
  periodid serial NOT NULL,
  periodnumber integer NOT NULL,
  periodstart time without time zone,
  periodend time without time zone,
  PRIMARY KEY (periodid)
)

Periodid  	Periodnumber  	Periodstart  	Periodend
6 	1 	2007/06/18 09:00:00 GMT+0 	2007/06/18 09:30:00 GMT+0
7 	2 	2007/06/18 09:30:00 GMT+0 	2007/06/18 10:00:00 GMT+0

Can anyone explain why time has todays date and time zone? I am confused, I only want time, such as:
13:00:00

You don't say what version you're running, but I can't reproduce this here on 8.2 - are you sure that table definition is right?

CREATE TABLE timetest (t1 time, t2 time without time zone, t3 timestamp without time zone);
INSERT INTO timetest values (now(),now(),now());
SELECT * FROM timetest;
       t1        |       t2        |             t3
-----------------+-----------------+----------------------------
 21:12:30.346289 | 21:12:30.346289 | 2007-06-18 21:12:30.346289
(1 row)

--
  Richard Huxton
  Archonet Ltd


[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