Re: Getting interval in seconds? - Mailing list pgsql-general

From Alex Pilosov
Subject Re: Getting interval in seconds?
Date
Msg-id Pine.BSO.4.10.10106102234210.17529-100000@spider.pilosoft.com
Whole thread Raw
In response to Getting interval in seconds?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
On Sun, 10 Jun 2001, Lincoln Yeoh wrote:

> Hi,
>
> How do I convert an interval to the number of seconds?
>
> e.g. I'd like the following to produce a result in seconds.
>
> select ('now'::timestamp - somedate)::interval from sometable;

select date_part('epoch',('now'::timestamp - somedate)::interval) from
sometable;

-alex


pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: Getting interval in seconds?
Next
From: Vivek Khera
Date:
Subject: Re: inserting, index and no index - speed