Re: time interval format srting

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: time interval format srting
Дата
Msg-id 20081104195726.GA10874@tux
обсуждение исходный текст
Ответ на Re: time interval format srting  (Sam Mason <sam@samason.me.uk>)
Ответы Re: time interval format srting  (Sam Mason <sam@samason.me.uk>)
Список pgsql-general
Sam Mason <sam@samason.me.uk> schrieb:

> On Tue, Nov 04, 2008 at 05:06:37PM +0000, Joao Ferreira gmail wrote:
> > I've been searching the docs on a simple way to convert a time
> > _duration_ in seconds to the format dd:hh:mm:ss, but I can't find it.
> >
> > 90061 --> 1d 1h 1m 1s
> >
> > (90061=24*3600+3600+60+1)
> >
> > any ideas ?
> >
> > I've been using to_char and to_timestamp to format dates/timestamps...
> > but this is diferent... I want to format time intervals, durations..
>
> How about doing:
>
>   SELECT justify_interval(90061 * '1 second'::INTERVAL);

Nice, didn't know this function.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Webb Sprague"
Дата:
Сообщение: Re: Semi-customized queries? Subset of SQL? Accessing the parser? Injection?
Следующее
От: Sam Mason
Дата:
Сообщение: Re: time interval format srting