Re: fomatting an interval (resend)

From: greg(at)turnstep(dot)com
To: pgsql-general(at)postgresql(dot)org
Cc: lyris-pg(at)tibit(dot)com
Subject: Re: fomatting an interval (resend)
Date: 2003-05-14 17:31:18
Message-ID: fc6c63dbf3f3e15baf195fd051cb1fbd@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


-----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(at)turnstep(dot)com
PGP Key: 0x14964AC8 200305141326

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

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-05-14 17:38:41 Re: Choosing a Transaction Isolation Level
Previous Message Mike Mascari 2003-05-14 17:22:27 Re: - what protocol for an Internet postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim GUNDUZ 2003-05-14 17:31:19 Re: DNS problem,
Previous Message Larry Rosenman 2003-05-14 17:25:29 Re: DNS problem,