Re: Date interval

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Richard Sydney-Smith <richard(at)ibisaustralia(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Date interval
Date: 2003-09-26 05:57:50
Message-ID: 3F73D55E.6030405@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message sad 2003-09-26 06:16:10 Re: Date interval
Previous Message Richard Sydney-Smith 2003-09-26 05:18:27 Date interval