Is there a builtin function for formatting time values? - Mailing list pgsql-general

From Frank Church
Subject Is there a builtin function for formatting time values?
Date
Msg-id 84b7c6461001281423w25f7553wef0931642f503ca1@mail.gmail.com
Whole thread Raw
Responses Re: Is there a builtin function for formatting time values?  (Adrian Klaver <adrian.klaver@gmail.com>)
List 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 by date:

Previous
From: Scott Ribe
Date:
Subject: Re: SQL question re aggregates & joins
Next
From: Adrian Klaver
Date:
Subject: Re: Is there a builtin function for formatting time values?