Re: Inconsistent time interval formatting

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Allen Chen <rocklob(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gary Chambers <gwchamb(at)gwcmail(dot)com>, Ben Chobot <bench(at)silentmedia(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Inconsistent time interval formatting
Date: 2011-01-13 22:45:35
Message-ID: 4D2F808F.4040503@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben Chobot 2011-01-13 23:38:53 Re: Inconsistent time interval formatting
Previous Message Jensen Somers 2011-01-13 22:26:29 Install PostgreSQL as part of a desktop application, but how to coop with existing installations?