Re: time without time zone

From: Richard Huxton <dev(at)archonet(dot)com>
To: Garry Saddington <garry(at)schoolteachers(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: time without time zone
Date: 2007-06-18 20:13:48
Message-ID: 4676E77C.7080602@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-06-18 20:15:36 Re: time without time zone
Previous Message Francisco Reyes 2007-06-18 20:06:22 Re: unexpected shutdown