|
| 1 | +From - Mon May 10 15:59:27 1999 |
| 2 | +Received: from localhost (lockhart@localhost [127.0.0.1]) |
| 3 | + by localhost (8.8.7/8.8.7) with ESMTP id PAA24871 |
| 4 | + for <lockhart@localhost>; Wed, 14 Apr 1999 15:45:24 GMT |
| 5 | +Received: from apop-server.alumni.caltech.edu |
| 6 | + by localhost with POP3 (fetchmail-4.7.9) |
| 7 | + for lockhart@localhost (single-drop); Wed, 14 Apr 1999 15:45:26 +0000 (UTC) |
| 8 | +Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) |
| 9 | + by alumnus.caltech.edu (8.9.1/8.9.1) with ESMTP id IAA18386 |
| 10 | + for <lockhart@alumni.caltech.edu>; Wed, 14 Apr 1999 08:41:45 -0700 (PDT) |
| 11 | +Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) |
| 12 | + by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id RAA15888; |
| 13 | + Wed, 14 Apr 1999 17:41:33 +0200 (MDT) |
| 14 | +Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] |
| 15 | + by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) |
| 16 | + id 10XTfQ-00083Z-00; Wed, 14 Apr 1999 17:41:40 +0000 |
| 17 | +Message-ID: <3714B6B6.F745D41D@sferacarta.com> |
| 18 | +Date: Wed, 14 Apr 1999 17:39:34 +0200 |
| 19 | +From: Jos� Soares <jose@sferacarta.com> |
| 20 | +X-Mailer: Mozilla 4.5 [it] (Win95; I) |
| 21 | +X-Accept-Language: it |
| 22 | +MIME-Version: 1.0 |
| 23 | +To: Thomas Lockhart <lockhart@alumni.caltech.edu> |
| 24 | +CC: hackers <pgsql-hackers@postgresql.org>, |
| 25 | + general <pgsql-general@postgresql.org> |
| 26 | +Subject: Re: [GENERAL] Re: [HACKERS] Gregorian Calendar |
| 27 | +References: <3711B1E5.80213DF6@sferacarta.com> <37135951.88FDB948@alumni.caltech.edu> |
| 28 | +Content-Transfer-Encoding: 8bit |
| 29 | +Content-Type: text/plain; charset=iso-8859-1 |
| 30 | +X-UIDL: 25f0580d2a532247ac6af3aee9737b7c |
| 31 | +X-Mozilla-Status: 8011 |
| 32 | +X-Mozilla-Status2: 00000000 |
| 33 | + |
| 34 | +Hi Thomas, |
| 35 | + |
| 36 | +Thomas Lockhart ha scritto: |
| 37 | + |
| 38 | +> > I have a question about dates. |
| 39 | +> > The Gregorian reform of calendar skiped 10 days on Oct, 1582. |
| 40 | +> > This reform was accepted by Great Britain and Dominions (including |
| 41 | +> > what is now the USA) only in 1752. |
| 42 | +> > If I insert a date that doesn't exist PostgreSQL accepts it. |
| 43 | +> > Should it be considered normal ? |
| 44 | +> |
| 45 | +> As Peter says, this is tricky. |
| 46 | +> |
| 47 | +> Date conventions before the 19th century make for interesting reading, |
| 48 | +> but are not imho consistant enough to warrant coding into a date/time |
| 49 | +> handler. |
| 50 | +> |
| 51 | +> As you probably have noticed, we use Julian date calculations for our |
| 52 | +> date/time support. |
| 53 | + |
| 54 | +I suppose you refer to Julian Day invented by the French scholar |
| 55 | +Joseph Justus Scaliger (1540-1609) |
| 56 | +that probably takes its name from the Scaliger's father, |
| 57 | +the Italian scholar Julius Caesar Scaliger (1484-1558). |
| 58 | +Astronomers have used the Julian period to assign a unique number to |
| 59 | +every day since 1 January 4713 BC. This is the so-called Julian Day |
| 60 | +(JD). JD 0 designates the 24 hours from noon UTC on 1 January 4713 BC |
| 61 | +to noon UTC on 2 January 4713 BC. |
| 62 | + |
| 63 | +Julian Day is different from Julian Date |
| 64 | + |
| 65 | +The Julian calendar was introduced by Julius Caesar in 45 BC. It was |
| 66 | +in common use until the 1582, when countries started changing to the |
| 67 | +Gregorian calendar. |
| 68 | + |
| 69 | +In the Julian calendar, the tropical year is approximated as 365 1/4 |
| 70 | +days = 365.25 days. This gives an error of 1 day in approximately 128 |
| 71 | + |
| 72 | +and this is why pope Gregory XIII in accordance with instructions |
| 73 | +from the Council of Trent reformed the calendar to correct this error. |
| 74 | + |
| 75 | +In the Gregorian calendar, the tropical year is approximated as |
| 76 | +365 + 97 / 400 days = 365.2425 days. Thus it takes approximately 3300 |
| 77 | +years for the tropical year to shift one day with respect to the |
| 78 | +Gregorian calendar. |
| 79 | + |
| 80 | +The approximation 365+97/400 is achieved by having 97 leap years |
| 81 | +every 400 years. |
| 82 | + |
| 83 | +The Gregorian calendar has 97 leap years every 400 years: |
| 84 | + |
| 85 | + Every year divisible by 4 is a leap year. |
| 86 | + However, every year divisible by 100 is not a leap year. |
| 87 | + However, every year divisible by 400 is a leap year after all. |
| 88 | + |
| 89 | +So, 1700, 1800, 1900, 2100, and 2200 are not leap years. But 1600, |
| 90 | +2000, and 2400 are leap years. |
| 91 | + |
| 92 | +instead in the Julian calendar only years divisible by 4 are leap years. |
| 93 | + |
| 94 | +The papal bull of February 1582 decreed that 10 days should be dropped |
| 95 | +from October 1582 so that 15 October should follow immediately after |
| 96 | +4 October. |
| 97 | +This was observed in Italy, Poland, Portugal, and Spain. Other Catholic |
| 98 | +countries followed shortly after, but Protestant countries were |
| 99 | +reluctant to change, and the Greek orthodox countries didn't change |
| 100 | +until the start of this century. |
| 101 | + |
| 102 | +The reform was observed by Great Britain and Dominions (including what is |
| 103 | +now the USA) |
| 104 | +in 1752. |
| 105 | +The 2 Sep 1752 was followed by 14 Sep 1752. |
| 106 | + |
| 107 | +This is why unix has the cal 9 1752 like this: |
| 108 | + September 1752 |
| 109 | + S M Tu W Th F S |
| 110 | + 1 2 14 15 16 |
| 111 | +17 18 19 20 21 22 23 |
| 112 | +24 25 26 27 28 29 30 |
| 113 | + |
| 114 | +My question is: |
| 115 | +^^^^^^^^^^^^ |
| 116 | + |
| 117 | +If SQL92 says: |
| 118 | + |
| 119 | + (Second Informal Review Draft) ISO/IEC 9075:1992, Database |
| 120 | + Language SQL- July 30, 1992 |
| 121 | + |
| 122 | +5.3 literals |
| 123 | + 22)Within the definition of a <datetime literal>, the <datetime |
| 124 | + value>s are constrained by the natural rules for dates and |
| 125 | +times |
| 126 | + according to the Gregorian calendar. |
| 127 | + ^^^^^^^^^^^^^^^ |
| 128 | + |
| 129 | +Dates between 1752-09-03 and 1752-09-13. |
| 130 | +Are they valid dates? |
| 131 | +^^^^^^^^^^^^^^^^ |
| 132 | + |
| 133 | +> They have the nice property of correctly |
| 134 | +> predicting/calculating any date more recent than something like 4013BC |
| 135 | +> to far into the future, using the assumption that the length of the |
| 136 | +> year is 365.25 days. This is a very recently adopted convention |
| 137 | +> (sometime in the 1800s I had thought, but perhaps it was during the |
| 138 | +> same "reform" in 1752). |
| 139 | +> |
| 140 | +> I've toyed with the idea of implementing a Chinese dynastic calendar, |
| 141 | +> since it seems to be more predictable than historical European |
| 142 | +> calendars. |
| 143 | + |
| 144 | +People's Republic of China uses the Gregorian calendar |
| 145 | +for civil purposes. Chinese calendar is used for determining |
| 146 | +festivals. |
| 147 | + |
| 148 | +The beginnings of the Chinese calendar can be traced back to the 14th |
| 149 | +century BC. Legend has it that the Emperor Huangdi invented the |
| 150 | +calendar in 2637 B |
| 151 | + |
| 152 | +Jos� |
| 153 | + |
| 154 | + |
| 155 | + |
0 commit comments