Re: Obtaining the Julian Day from a date

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Obtaining the Julian Day from a date
Дата
Msg-id 20040911013254.GA9447@wolff.to
обсуждение исходный текст
Ответ на Re: Obtaining the Julian Day from a date  ("Karl O. Pinc" <kop@meme.com>)
Ответы Re: Obtaining the Julian Day from a date
Список pgsql-general
On Thu, Sep 09, 2004 at 16:32:18 -0500,
  "Karl O. Pinc" <kop@meme.com> wrote:
>
> 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.)

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.

You could also do the subtraction before storing the data if you want
to keep it internally as Julian days.

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 8.0.0beta2: gcc: unrecognized option `-pthreads'
Следующее
От: Randy Yates
Дата:
Сообщение: Another Security Question: User-based Roles vs. Application Business Rules