Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
Adrian: On Thu, Sep 12, 2019 at 4:23 PM Adrian Klaver wrote: > > pure_seconds_interval > > --- > > 3923:00:00 > > (1 row) > > > > A third representation! which gives the same result for epoch, but I'm > > not sure it does for arithmetic( tested it, it does not ) > > > >

Re: How to reformat output of "age()" function

2019-09-12 Thread Adrian Klaver
On 9/12/19 4:50 AM, Francisco Olarte wrote: Adrian: On Wed, Sep 11, 2019 at 11:19 PM Adrian Klaver wrote: On 9/11/19 9:34 AM, Francisco Olarte wrote: ... If you want to know the elapsed minutes between two timestamps, it might be better to do it directly, extract the epoch from both ( second

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
Adrian: On Wed, Sep 11, 2019 at 11:19 PM Adrian Klaver wrote: > On 9/11/19 9:34 AM, Francisco Olarte wrote: ... > > If you want to know the elapsed minutes between two timestamps, it > > might be better to do it directly, extract the epoch from both ( > > seconds ), substract, divide by 60 trunca

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
OOps, I got it bad: On Thu, Sep 12, 2019 at 1:50 PM Francisco Olarte wrote: > timestamp / interval arithmetic is really a hairy thing. ( As shown > below, start point carefully taken to avoid crossing dsts ) It was chosen to FORCE, not AVOID, crossing dst. > cdrs=# select x, '2019.11.20 20:00:

Re: How to reformat output of "age()" function

2019-09-11 Thread Adrian Klaver
On 9/11/19 9:34 AM, Francisco Olarte wrote: David: On Wed, Sep 11, 2019 at 5:39 PM David Gauthier 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

Re: How to reformat output of "age()" function

2019-09-11 Thread David Gauthier
Thanks a lot! On Wed, Sep 11, 2019 at 12:34 PM Francisco Olarte wrote: > David: > > On Wed, Sep 11, 2019 at 5:39 PM David Gauthier > 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-

Re: How to reformat output of "age()" function

2019-09-11 Thread Francisco Olarte
David: On Wed, Sep 11, 2019 at 5:39 PM David Gauthier 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

Re: How to reformat output of "age()" function

2019-09-11 Thread Basques, Bob (CI-StPaul)
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: https://stackoverflow.com/questions/3460805/postgresql-format-interval-as-minutes bobb On Sep 11, 2019, at 10:38 AM, David Gauthier mailto:davegau

Re: How to reformat output of "age()" function

2019-09-11 Thread Ron
On 9/11/19 10:38 AM, David Gauthier 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

How to reformat output of "age()" function

2019-09-11 Thread David Gauthier
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