Re: Date interval - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: Date interval
Date
Msg-id 3F73D55E.6030405@klaster.net
Whole thread Raw
In response to Date interval  ("Richard Sydney-Smith" <richard@ibisaustralia.com>)
List pgsql-sql
> I am looking for a way to convert an interval into a number of days ( 
> integer);
>  
> In sybase I would use :
>  
> days(today()-r_expire)
>  
> where r_expire is the timestamp I am comparing against.
>  
> How do we do this in postgres?
>  
> date_trunc(today()-r_expire) does not seem to do it

select extract(epoch from some_interval)/3600/24::integer

Regards,
Tomasz Myrta



pgsql-sql by date:

Previous
From: "Richard Sydney-Smith"
Date:
Subject: Date interval
Next
From: sad
Date:
Subject: Re: Date interval