Re: Return from timestamp column

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Jack Zhu <jzhu(at)netcom-sys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Return from timestamp column
Date: 2000-05-02 23:15:31
Message-ID: 20000502161531.C9246@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Jack Zhu <jzhu(at)netcom-sys(dot)com> [000502 15:52] wrote:
> Hi, all:
>
> PostgreSQL 7 Beta 5 on Red hat Linux 6.0
>
> We have a a table which has a column col_a with 'timestamp' data type. When
> insert time value to this column, we use format which is 'MM/DD/YYYY
> HH24:MI:SS' (such as '05/01/2000 13:20:02'). Insertion is OK.
>
> But when we try to read this column, the output is '05/01/2000
> 13:20:02.20-04', which is not what we need. We don't need the '.20-04' part
> of the output, that is nano second and time zone part.
>
> Is there any ways that make the output doesn't contain the nano second and
> time zone part?
>
> Thnx a lot!

I think the date_trunc() function is what you need to use.

--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Dalphin 2000-05-02 23:16:29 Re: RE: One last thing... psql and readline
Previous Message Robert B. Easter 2000-05-02 22:17:36 Automatically deleting dangling large object references.