Re: Obtaining the Julian Day from a date

Поиск
Список
Период
Сортировка
От Karl O. Pinc
Тема Re: Obtaining the Julian Day from a date
Дата
Msg-id 20040909163218.K31452@mofo.meme.com
обсуждение исходный текст
Ответ на Obtaining the Julian Day from a date  ("Karl O. Pinc" <kop@meme.com>)
Ответы Re: Obtaining the Julian Day from a date  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
On 2004.09.09 14:11 Bruno Wolff III wrote:
> On Thu, Sep 09, 2004 at 12:35:14 -0500,
>   "Karl O. Pinc" <kop@meme.com> wrote:
> > 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.
>
> You might be interested to know that there are operators that combine
> date and integer types that might be usable directly instead of
> converting to Julian days.

Thanks.  (It's not documented for 7.3 but works.  It is documented
for 7.4.)

Unfortunately modulo (%) does not operate on dates so I still need

to convert to Julian day.  :-(  I need to know where I am within a
regular repeating interval.  Mostly, in my case, modulo 2.
(We arbitrarly decided to begin our interval on Julian Day 0.)

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

В списке pgsql-general по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: [JDBC] ERROR: canceling query due to user request
Следующее
От: Jeff Amiel
Дата:
Сообщение: Re: How to determine a database is intact?