Is there a builtin function for formatting time values?

Поиск
Список
Период
Сортировка
От Frank Church
Тема Is there a builtin function for formatting time values?
Дата
Msg-id 84b7c6461001281423w25f7553wef0931642f503ca1@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is there a builtin function for formatting time values?
Список pgsql-general
I have to this to extract formated times from timestamps, but I
suspect there is something much better, even if it uses a stored
procedure. The lpad command to is also  funny because I have to
concatenate it with an empty quote to convert the output to a string.

select lpad(extract(hour from calldate) || '', 2, '0') || ':' ||
lpad(extract(minute from calldate) || '', 2, '0') || ':' ||
lpad(extract(second from calldate) || '', 2, '0')  from asterisk_cdr

There must be a formattted into to string function or a formatted time
function somewhere.

Are there any links to PostgreSQL stored procedure libraries?


/voipfc

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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: SQL question re aggregates & joins
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Is there a builtin function for formatting time values?