Re: Return from timestamp column

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема Re: Return from timestamp column
Дата
Msg-id 20000502161531.C9246@fw.wintelcom.net
обсуждение исходный текст
Ответ на Return from timestamp column  ("Jack Zhu" <jzhu@netcom-sys.com>)
Список pgsql-general
* Jack Zhu <jzhu@netcom-sys.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@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jack Zhu"
Дата:
Сообщение: Return from timestamp column
Следующее
От: Mark Dalphin
Дата:
Сообщение: Re: RE: One last thing... psql and readline