Re: How to reformat output of "age()" function - Mailing list pgsql-general

From Basques, Bob (CI-StPaul)
Subject Re: How to reformat output of "age()" function
Date
Msg-id 1402ED33-C80E-43E0-AB2A-D29326CAD3A7@ci.stpaul.mn.us
Whole thread Raw
In response to How to reformat output of "age()" function  (David Gauthier <davegauthierpg@gmail.com>)
List pgsql-general
SELECT EXTRACT(EPOCH FROM age('2019-09-11 09:00:00','2019-09-09 11:00:00')::INTERVAL)/60;

A nice explanation and even a slick function are here:


bobb



On Sep 11, 2019, at 10:38 AM, David Gauthier <davegauthierpg@gmail.com> wrote:



How can I change the default output of the "age" function to be, for example, in minutes?

E.g.
dvdb=> select age('2019-09-11 09:00:00','2019-09-09 11:00:00');
      age      
----------------
 1 day 22:00:00
(1 row)

I want the equivalent of that time delta in minutes.

Thanks in Advance 

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: How to reformat output of "age()" function
Next
From: Francisco Olarte
Date:
Subject: Re: How to reformat output of "age()" function