diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
commit | 6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch) | |
tree | 657d8194422a5daccecfd42d654b8a245ef7b4c8 /doc/src/sgml/html/datetime-units-history.html | |
parent | Initial commit. (diff) | |
download | postgresql-13-upstream.tar.xz postgresql-13-upstream.zip |
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/html/datetime-units-history.html')
-rw-r--r-- | doc/src/sgml/html/datetime-units-history.html | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/doc/src/sgml/html/datetime-units-history.html b/doc/src/sgml/html/datetime-units-history.html new file mode 100644 index 0000000..f7ef1ff --- /dev/null +++ b/doc/src/sgml/html/datetime-units-history.html @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>B.6. History of Units</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="datetime-posix-timezone-specs.html" title="B.5. POSIX Time Zone Specifications" /><link rel="next" href="datetime-julian-dates.html" title="B.7. Julian Dates" /></head><body id="docContent" class="container-fluid col-10"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">B.6. History of Units</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="datetime-posix-timezone-specs.html" title="B.5. POSIX Time Zone Specifications">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="datetime-appendix.html" title="Appendix B. Date/Time Support">Up</a></td><th width="60%" align="center">Appendix B. Date/Time Support</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="datetime-julian-dates.html" title="B.7. Julian Dates">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="DATETIME-UNITS-HISTORY"><div class="titlepage"><div><div><h2 class="title" style="clear: both">B.6. History of Units</h2></div></div></div><a id="id-1.11.3.9.2" class="indexterm"></a><p> + The SQL standard states that <span class="quote">“<span class="quote">Within the definition of a + <span class="quote">‘<span class="quote">datetime literal</span>’</span>, the <span class="quote">‘<span class="quote">datetime + values</span>’</span> are constrained by the natural rules for dates and + times according to the Gregorian calendar</span>”</span>. + <span class="productname">PostgreSQL</span> follows the SQL + standard's lead by counting dates exclusively in the Gregorian + calendar, even for years before that calendar was in use. + This rule is known as the <em class="firstterm">proleptic Gregorian calendar</em>. + </p><p> + The Julian calendar was introduced by Julius Caesar in 45 BC. + It was in common use in the Western world + until the year 1582, when countries started changing to the Gregorian + calendar. In the Julian calendar, the tropical year is + approximated as 365 1/4 days = 365.25 days. This gives an error of + about 1 day in 128 years. + </p><p> + The accumulating calendar error prompted + Pope Gregory XIII to reform the calendar in accordance with + instructions from the Council of Trent. + In the Gregorian calendar, the tropical year is approximated as + 365 + 97 / 400 days = 365.2425 days. Thus it takes approximately 3300 + years for the tropical year to shift one day with respect to the + Gregorian calendar. + </p><p> + The approximation 365+97/400 is achieved by having 97 leap years + every 400 years, using the following rules: + + </p><table border="0" summary="Simple list" class="simplelist"><tr><td> + Every year divisible by 4 is a leap year. + </td></tr><tr><td> + However, every year divisible by 100 is not a leap year. + </td></tr><tr><td> + However, every year divisible by 400 is a leap year after all. + </td></tr></table><p> + + So, 1700, 1800, 1900, 2100, and 2200 are not leap years. But 1600, + 2000, and 2400 are leap years. + + By contrast, in the older Julian calendar all years divisible by 4 are leap + years. + </p><p> + The papal bull of February 1582 decreed that 10 days should be dropped + from October 1582 so that 15 October should follow immediately after + 4 October. + This was observed in Italy, Poland, Portugal, and Spain. Other Catholic + countries followed shortly after, but Protestant countries were + reluctant to change, and the Greek Orthodox countries didn't change + until the start of the 20th century. + + The reform was observed by Great Britain and its dominions (including what + is now the USA) in 1752. + Thus 2 September 1752 was followed by 14 September 1752. + + This is why Unix systems that have the <code class="command">cal</code> program + produce the following: + +</p><pre class="screen"> +$ <strong class="userinput"><code>cal 9 1752</code></strong> + September 1752 + S M Tu W Th F S + 1 2 14 15 16 +17 18 19 20 21 22 23 +24 25 26 27 28 29 30 +</pre><p> + + But, of course, this calendar is only valid for Great Britain and + dominions, not other places. + Since it would be difficult and confusing to try to track the actual + calendars that were in use in various places at various times, + <span class="productname">PostgreSQL</span> does not try, but rather follows the Gregorian + calendar rules for all dates, even though this method is not historically + accurate. + </p><p> + Different calendars have been developed in various parts of the + world, many predating the Gregorian system. + + For example, + the beginnings of the Chinese calendar can be traced back to the 14th + century BC. Legend has it that the Emperor Huangdi invented that + calendar in 2637 BC. + + The People's Republic of China uses the Gregorian calendar + for civil purposes. The Chinese calendar is used for determining + festivals. + </p></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="datetime-posix-timezone-specs.html" title="B.5. POSIX Time Zone Specifications">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="datetime-appendix.html" title="Appendix B. Date/Time Support">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="datetime-julian-dates.html" title="B.7. Julian Dates">Next</a></td></tr><tr><td width="40%" align="left" valign="top">B.5. <acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">POSIX</acronym> Time Zone Specifications </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> B.7. Julian Dates</td></tr></table></div></body></html>
\ No newline at end of file |