Skip to content

Commit 164d255

Browse files
committed
Improve documentation about Julian dates; in particular, point out the
difference between Julian and Gregorian reckoning of when JD 0 was.
1 parent 21e07f6 commit 164d255

File tree

2 files changed

+44
-30
lines changed

2 files changed

+44
-30
lines changed

doc/src/sgml/datetime.sgml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.57 2007/12/02 22:33:20 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.58 2007/12/15 01:18:33 tgl Exp $ -->
22

33
<appendix id="datetime-appendix">
44
<title>Date/Time Support</title>
@@ -470,20 +470,8 @@
470470
<title>History of Units</title>
471471

472472
<para>
473-
The Julian Date was invented by the French scholar
474-
Joseph Justus Scaliger (1540-1609)
475-
and probably takes its name from Scaliger's father,
476-
the Italian scholar Julius Caesar Scaliger (1484-1558).
477-
Astronomers have used the Julian period to assign a unique number to
478-
every day since 1 January 4713 BC. This is the so-called Julian Date
479-
(JD). JD 0 designates the 24 hours from noon UTC on 1 January 4713 BC
480-
to noon UTC on 2 January 4713 BC.
481-
</para>
482-
483-
<para>
484-
The <quote>Julian Date</quote> is different from the <quote>Julian
485-
Calendar</quote>. The Julian calendar
486-
was introduced by Julius Caesar in 45 BC. It was in common use
473+
The Julian calendar was introduced by Julius Caesar in 45 BC.
474+
It was in common use in the Western world
487475
until the year 1582, when countries started changing to the Gregorian
488476
calendar. In the Julian calendar, the tropical year is
489477
approximated as 365 1/4 days = 365.25 days. This gives an error of
@@ -529,7 +517,7 @@
529517
4 October.
530518
This was observed in Italy, Poland, Portugal, and Spain. Other Catholic
531519
countries followed shortly after, but Protestant countries were
532-
reluctant to change, and the Greek orthodox countries didn't change
520+
reluctant to change, and the Greek Orthodox countries didn't change
533521
until the start of the 20th century.
534522

535523
The reform was observed by Great Britain and Dominions (including what is
@@ -549,30 +537,56 @@ $ <userinput>cal 9 1752</userinput>
549537
</screen>
550538
</para>
551539

552-
<note>
553-
<para>
554-
The SQL standard states that <quote>Within the definition of a
555-
<quote>datetime literal</quote>, the <quote>datetime
556-
value</quote>s are constrained by the natural rules for dates and
557-
times according to the Gregorian calendar</quote>. Dates between
558-
1752-09-03 and 1752-09-13, although eliminated in some countries
559-
by Papal fiat, conform to <quote>natural rules</quote> and are
560-
hence valid dates.
561-
</para>
562-
</note>
540+
<para>
541+
The SQL standard states that <quote>Within the definition of a
542+
<quote>datetime literal</quote>, the <quote>datetime
543+
value</quote>s are constrained by the natural rules for dates and
544+
times according to the Gregorian calendar</quote>. Dates between
545+
1582-10-05 and 1582-10-14, although eliminated in some countries
546+
by Papal fiat, conform to <quote>natural rules</quote> and are
547+
hence valid dates. <productname>PostgreSQL</> follows the SQL
548+
standard's lead by counting dates exclusively in the Gregorian
549+
calendar, even for years before that calendar was in use.
550+
</para>
563551

564552
<para>
565553
Different calendars have been developed in various parts of the
566554
world, many predating the Gregorian system.
567555

568556
For example,
569557
the beginnings of the Chinese calendar can be traced back to the 14th
570-
century BC. Legend has it that the Emperor Huangdi invented the
558+
century BC. Legend has it that the Emperor Huangdi invented that
571559
calendar in 2637 BC.
572560

573561
The People's Republic of China uses the Gregorian calendar
574562
for civil purposes. The Chinese calendar is used for determining
575563
festivals.
576564
</para>
565+
566+
<para>
567+
The <quote>Julian Date</quote> is unrelated to the <quote>Julian
568+
calendar</quote>.
569+
The Julian Date system was invented by the French scholar
570+
Joseph Justus Scaliger (1540-1609)
571+
and probably takes its name from Scaliger's father,
572+
the Italian scholar Julius Caesar Scaliger (1484-1558).
573+
In the Julian Date system, each day has a sequential number, starting
574+
from JD 0 (which is sometimes called <emphasis>the</> Julian Date).
575+
JD 0 corresponds to 1 January 4713 BC in the Julian calendar, or
576+
24 November 4714 BC in the Gregorian calendar. Julian Date counting
577+
is most often used by astronomers for labeling their nightly observations,
578+
and therefore a date runs from noon UTC to the next noon UTC, rather than
579+
from midnight to midnight: JD 0 designates the 24 hours from noon UTC on
580+
1 January 4713 BC to noon UTC on 2 January 4713 BC.
581+
</para>
582+
583+
<para>
584+
Although <productname>PostgreSQL</> supports Julian Date notation for
585+
input and output of dates (and also uses them for some internal datetime
586+
calculations), it does not observe the nicety of having dates run from
587+
noon to noon. <productname>PostgreSQL</> treats a Julian Date as running
588+
from midnight to midnight.
589+
</para>
590+
577591
</sect1>
578592
</appendix>

doc/src/sgml/func.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.417 2007/12/13 13:22:05 alvherre Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.418 2007/12/15 01:18:34 tgl Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -4960,7 +4960,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
49604960
</row>
49614961
<row>
49624962
<entry><literal>J</literal></entry>
4963-
<entry>Julian Day (days since January 1, 4712 BC at midnight)</entry>
4963+
<entry>Julian Day (days since November 24, 4714 BC at midnight)</entry>
49644964
</row>
49654965
<row>
49664966
<entry><literal>Q</literal></entry>

0 commit comments

Comments
 (0)