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

From Karl O. Pinc
Subject Re: Obtaining the Julian Day from a date
Date
Msg-id 20040911095459.A11306@mofo.meme.com
Whole thread Raw
In response to Re: Obtaining the Julian Day from a date  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Obtaining the Julian Day from a date  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 2004.09.10 20:32 Bruno Wolff III wrote:

> If you keep your data in a date field you can get the Julian day
> by subtracting the appropiate date. You can then do mod on this
> difference.

I've been doing:

CAST (to_char(date, 'J') AS INT)

but your way seems faster.  Is it?

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

pgsql-general by date:

Previous
From: "William Herring"
Date:
Subject: table with a variable name???
Next
From: Peter Eisentraut
Date:
Subject: Re: table with a variable name???