Re: Inconsistent time interval formatting - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Inconsistent time interval formatting
Date
Msg-id 4D2F808F.4040503@gmail.com
Whole thread Raw
In response to Re: Inconsistent time interval formatting  (Allen Chen <rocklob@gmail.com>)
List pgsql-general
On 01/13/2011 12:55 PM, Allen Chen wrote:
>
>
>     That won't really help.  The fundamental point here is that '1 day' is
>     not the same concept as '24 hours', because of DST changes; and the
>     interval type treats them as different.
>
>     If you don't care about that, you can use justify_hours (I think that's
>     the right function) to smash them to the same thing.
>
>     But I suspect the OP's real complaint would be better solved by use of
>     to_char() to produce an output format that includes zeroes instead of
>     dropping fields that are zero.
>
>                             regards, tom lane
>
>
> Hi Tom,
>
> I don't understand how DST changes matter for a time interval or how
> that could even be factored into calculations.  Could you elaborate on
> that?  I had a query today that returned an interval of
> 70:23:06.935933.  Wouldn't that be at least two days regardless of DST?
>
> Thanks for shining the light on justify_hours, though.  I did not know
> that function existed.  That does give me a way to have consistent
> output for reporting.
>
> Thanks to everyone who replied!
>
> -Allen
>

I think to help with this we will need the complete cycle, in other
words the queries you are using to generate the intervals as well as the
resultant intervals.

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Jensen Somers
Date:
Subject: Install PostgreSQL as part of a desktop application, but how to coop with existing installations?
Next
From: Ben Chobot
Date:
Subject: Re: Inconsistent time interval formatting