Re: rounding timestamps
От
Alvaro Herrera
Тема
Re: rounding timestamps
Дата
Msg-id
20031124032741.GA15475@dcc.uchile.cl
Ответ на
rounding timestamps (Claudio Lapidus)
Список
Дерево обсуждения
Re: rounding timestamps "Claudio Lapidus" <clapidus@hotmail.com>
On Mon, Nov 24, 2003 at 12:15:54AM -0300, Claudio Lapidus wrote: > But my problem is that to_char truncates the fractional seconds, and I need > to round the value to the nearest integer second. In the above, I would need > the output rounded to 15:31:00, which is just a millisecond away, for > example. But I couldn't find a function to round a timestamp. Are there any > workaround? Maybe you can try with EXTRACT(epoch FROM timestamp), rounding that, and then converting back to a timestamp through abstime. Ugly though ... -- Alvaro Herrera () "Hoy es el primer día del resto de mi vida"
В списке pgsql-general по дате отправления