Re: fomatting an interval (resend) - Mailing list pgsql-general

From greg@turnstep.com
Subject Re: fomatting an interval (resend)
Date
Msg-id fc6c63dbf3f3e15baf195fd051cb1fbd@biglumber.com
Whole thread Raw
In response to Re: fomatting an interval (resend)  ("Forest Wilkinson" <lyris-pg@tibit.com>)
Responses Re: fomatting an interval  (lyris-pg@tibit.com)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> Okay, so extract() doesn't fit the bill either.  How do I get the
> difference between two timestamps in terms of days, expressed as an
> integer?  Moreover, how do I get any interval expressed in those
> terms?

select round((extract(epoch from finish) - extract(epoch from start))/(60*60*24))
  from timetable;

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200305141326

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+wnzCvJuQZxSWSsgRAkEJAKDpgxGsi9Y+0mp74t1TqQe8xc7CKwCg2NFf
uS25ZUK0P8d5bnasX581+dA=
=kZ96
-----END PGP SIGNATURE-----




pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: Re: - what protocol for an Internet postgres
Next
From: "scott.marlowe"
Date:
Subject: Re: Choosing a Transaction Isolation Level