Search Postgresql Archives

Re: Duration between two timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 04, 2005 at 10:37:52AM -0500, phil campaigne wrote:
> 
> Hi All,
> I have stored event records in Postgresql 7.3.4 and now need to 
> calculate the duration between each event in succession.  I have 
> "record_id" and a" timestamp without time zone" columns for each event.
> 
> What is a good way to calculate the difference in timestamp and store it 
> in the record as duration.  I am doing this as part of a java 
> application on RH linux 8.0.

Have you tried just subtracting them? That will give you a value of
type "interval" which you can then store...

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpMbFd0FEqNb.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux