Re: format return of "age" to hh:mm - Mailing list pgsql-general

From Andrei Zhidenkov
Subject Re: format return of "age" to hh:mm
Date
Msg-id B8FA4081-EB2C-4017-B36B-3B2B6F326CDC@n26.com
Whole thread Raw
In response to Re: format return of "age" to hh:mm  (Ray O'Donnell <ray@rodonnell.ie>)
List pgsql-general
However, you cannot use to_char() to display the count of days for a given interval. In this case, if your interval is
largerthan 24 hours, you might use extract(epoch from <interval>) and perform the conversion manually. 

> On 5. Mar 2020, at 17:07, Ray O'Donnell <ray@rodonnell.ie> wrote:
>
> On 05/03/2020 15:50, David Gauthier wrote:
>> Hi:
>>
>> How does one reformat the output of the "age" function to always be in
>> terms of hours:mins.
>
> Hi there,
>
> age() returns an interval, so without having tried it I'm guessing you
> could use to_char() to format it whatever way you want.
>
> Ray.
>
> --
> Raymond O'Donnell // Galway // Ireland
> ray@rodonnell.ie
>
>




pgsql-general by date:

Previous
From: Ray O'Donnell
Date:
Subject: Re: format return of "age" to hh:mm
Next
From: "David G. Johnston"
Date:
Subject: Re: format return of "age" to hh:mm