Re: Obtaining the Julian Day from a date

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: "Karl O(dot) Pinc" <kop(at)meme(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Obtaining the Julian Day from a date
Date: 2004-09-11 14:54:59
Message-ID: 20040911095459.A11306@mofo.meme.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leo Martin Orfei 2004-09-11 15:23:48 Re: problems returning a resultset from a function
Previous Message Peter Eisentraut 2004-09-11 14:39:51 Re: table with a variable name???