Re: Julian Day 0 question

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Julian Day 0 question
Дата
Msg-id 162867790712141257u3d9fbb40l215d63ffea5e423@mail.gmail.com
обсуждение исходный текст
Ответ на Julian Day 0 question  (Andrew Chernow <ac@esilo.com>)
Ответы Re: Julian Day 0 question  (Andrew Chernow <ac@esilo.com>)
Список pgsql-general
On 14/12/2007, Andrew Chernow <ac@esilo.com> wrote:
> Ran across something that is confusing me.  The docs for to_char
> indicates that julian day 0 is January 1, 4712 BC at midnight.
>
> http://www.postgresql.org/docs/8.3/static/functions-formatting.html
>
> When I run to_char, I don't get 0 for that date.
>
> postgres=# select to_char('4712-01-01 BC'::date, 'J');
>   to_char
> ---------
>   404
>
> I get julian day 0 for 4714-11-24 BC.
>
> postgres=# select to_char('4714-11-24 BC'::date, 'J');
>   to_char
> ---------
>   0
>
> Output of 'select version()'
>
> PostgreSQL 8.3devel on x86_64-unknown-linux-gnu, compiled by GCC gcc
> (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
>
> andrew
>

there is more strange things

postgres=# select to_date('0', 'J');
    to_date
---------------
 0001-01-01 BC
(1 row)

it's wrong, correct is probably ERROR:  timestamp out of range

postgres=# select to_date('1', 'J');
    to_date
---------------
 4714-11-25 BC
(1 row)

Regards
Pavel Stehule

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

Предыдущее
От: brian
Дата:
Сообщение: Re: user name and password woes
Следующее
От: Andrew Chernow
Дата:
Сообщение: Re: Julian Day 0 question