Re: documentation bug?

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: documentation bug?
Дата
Msg-id 1073335705.25138.1372.camel@linda.lfix.co.uk
обсуждение исходный текст
Ответ на documentation bug?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Список pgsql-hackers
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
allthy soul, and with all thy might."                Deuteronomy 6:5 
 



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

Предыдущее
От: ivan
Дата:
Сообщение: Re: time format
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: PL/Java issues