Obtaining the Julian Day from a date - Mailing list pgsql-general

From Karl O. Pinc
Subject Obtaining the Julian Day from a date
Date
Msg-id 20040909123514.A31452@mofo.meme.com
Whole thread Raw
Responses Re: Obtaining the Julian Day from a date
Re: Obtaining the Julian Day from a date
List pgsql-general
Hi,

What's the best way to obtain the Julian day from a postgresql
date?

PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC
i386-redhat-linux-gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

I'm doing some date arithmetic with 1 day intervals and want
to, for example, round to the even Julian day.  I suppose
I could always take the interval from julian day zero
and then divide by the number of seconds in a day, but that
sounds both brutal and potentially inaccurate due to leap
seconds and so forth.

There's mention of being able to do  this in the list archives,
but nobody says how it's actually done.

Thanks.

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein

pgsql-general by date:

Previous
From: Frank Finner
Date:
Subject: Re: Upgrading PostgreSQL 7.1.3
Next
From: Wes
Date:
Subject: Re: How to determine a database is intact?