Julian Day 0 question

From: Andrew Chernow <ac(at)esilo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Julian Day 0 question
Date: 2007-12-14 19:44:00
Message-ID: 4762DD00.3030305@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Hixson 2007-12-14 19:51:58 settings for 8.2.5 on Mac OS X 10.4.11
Previous Message Andrej Ricnik-Bay 2007-12-14 18:45:08 Re: Hijack!