I see following in the doc:

Table 9-21. Template Patterns for Date/Time Formatting
:
:
J Julian Day (days since January 1, 4712 BC)

I think 4712 should be 4713.
--
Tatsuo Ishii

Mon, 05 Jan 2004 19:02:16 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
documentation bug?
On Mon, 2004-01-05 at 10:02, Tatsuo Ishii wrote:
> I see following in the doc:
> 
> Table 9-21. Template Patterns for Date/Time Formatting
> :
> :
> J Julian Day (days since January 1, 4712 BC)
> 
> I think 4712 should be 4713. 

template1=# select to_char('1 Jan 4713BC'::date,'J');
 to_char
---------
 38
(1 row)

template1=# select to_char('24 Nov 4714BC'::date,'J');
 to_char
---------
 0
(1 row)

I think that 1 Jan 4713BC is by the Julian calendar, whereas SQL dates
are defined to be by the Gregorian calendar (even before it existed). 
Those 38 days are presumably the difference between the two calendar
systems at that date.

Here's a little bug:  
template1=# select to_char('24 Nov 0001'::date,'J');
 to_char
---------
 1721753
(1 row)

template1=# select to_char('24 Nov 0000'::date,'J');
 to_char
---------
 1721388
(1 row)

There is no year 0, so this ought to give an error.  It may explain why
we go back to 4713BC instead of 4712BC.


-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "And thou shalt love the LORD thy God with all thine 
      heart, and with all thy soul, and with all thy might."
                 Deuteronomy 6:5 


Mon, 05 Jan 2004 20:48:26 +0000
Oliver Elphick <olly@lfix.co.uk>
Re: documentation bug?