format return of "age" to hh:mm

From: David Gauthier <davegauthierpg(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: format return of "age" to hh:mm
Date: 2020-03-05 15:50:31
Message-ID: CAMBRECB7TGJzy5X7i3XBopz2q5qhR1Di358upEKmLukpWBjWdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:

How does one reformat the output of the "age" function to always be in
terms of hours:mins.

E.g.

dvdb=> select age('2020-03-05 01:40:32-05','2020-03-01 21:56:05-05');
age
-----------------
3 days 03:44:27
(1 row)

I want...

"75:44"

I'm not married to "age" If there's a better way to do this that's fine
too.

Thanks in advance !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2020-03-05 15:58:32 Re: A question about the number of times a trigger will fire
Previous Message Kevin Brannen 2020-03-05 15:45:25 RE: trouble making PG use my Perl