Re: Getting timestamp without milliseconds

Поиск
Список
Период
Сортировка
От John Sidney-Woollett
Тема Re: Getting timestamp without milliseconds
Дата
Msg-id 43BD4663.6060501@wardbrook.com
обсуждение исходный текст
Ответ на Getting timestamp without milliseconds  ("Tadej Kanizar" <Tadej.Kanizar@sagit-server.com>)
Список pgsql-general
Either date_trunc

eg, SELECT date_trunc('hour', TIMESTAMP '2001-02-16 20:38:40');
Result: 2001-02-16 20:00:00

Or format the timestamp as a string

select to_char(now(), 'yyyy-mm-dd HH24:MI:SS');

Hope that helps.

John

Tadej Kanizar wrote:
> Hi!
>
>
>
> I've got a timestamp field.. and it returns sth like "2006-01-04
> 21:33:17.156". How can I get the same result, just without the .156? I've
> looked at date/time formatting functions, etc, but couldn't find a straight
> way to do this :-(
>
> Thanks.
>
>
>
> Regards,
>
> Tadej
>
>

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

Предыдущее
От: "Tadej Kanizar"
Дата:
Сообщение: Getting timestamp without milliseconds
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Getting timestamp without milliseconds