Re: Gregorian Calendar switch
Posted in 1998
Graham Crookham wrote: > Leffler, Jonathan wrote: > > True, but whose calendar should it use? The British? The > > continental one (which switched in 1684, I believe, and only > > skipped 10 days), or the Russian one (which switched in 1918 > > or shortly after that), or ... > > > > >and orders dates prior to this incorrectly > > > > This I find hard to believe; very hard to believe. Justify this > > assertion! Graham, I consider your assertion justified, within your terms of reference. > I am writing a system for use in the British Isles requiring the > use of dates back to 1200.The change of year in the British Isles > took place on 25th of March orior to 1752 and not 01st January. > If you order by dates prior to 1752, say 1720, the database orders > by the current Gregorian calendar and not the Julian that was > actually in use, so whereas in reality the dates would have gone > sequentially 23/03/1720, 24/03/1720, 25/03/1721, 26/03/1721, > Informix will order the dates prior to 25th March in the wrong > place, i.e. it will order 24/03/1721, 25/03/1721 where in fact > these dates are a year apart and should be ordered 25/03/1721, > 24/03/1721. Thanks for this information -- I knew vaguely something about the end of the year being one of the quarter days, but I hadn't realized that it worked like that! One piece of date lore which had completely bypassed me, and thanks for the information. Within your terms of reference, your assertion is correct. Within Informix's terms of reference, its behaviour is correct. Unfortunately, the two terms of reference are different and not compatible. Using raw Informix dates is not going to work for your application. Informix dates take the date system in force at the end of the 20th Century and project it backwards in time to (its conception of) 1st January 1 AD. That ignores another bunch of problems with the calendrical changes in the early parts of the first millenium, too. I think that if I were in your shoes, I would store the UKHistoricalDate values in my own type -- much easier to do in IUS. With ODS, I'd simply store them as integers and use a bunch of conversion functions to handle the formatting. Using integers means that the dates will be ordered correctly. Using your conversion functions means that the date 73,000 days before 1st January 1900 (somewhere in early 1700 (or, conceivably late 1699) unless my brain is too addled to do mental arithmetic, which is quite possible) will be formatted differently from the way the Informix code would format the same day. Note, incidentally, that for dates after September 1752, you could use the Informix date conversion functions. For earlier dates, it would be worth considering whether to use the Informix date functions to convert between string and UKHistoricalDate by applying appropriate offsets to the UKHistoricalDate value to get Informix to produce the date you desire. > > >as well as accepting dates that did not exist (Half of september ws > > actually missing). > > > > Only in Britain; those dates all existed on the continent of Europe. > > True, but my application is specific to the British Isles Which, I regret to say, makes it unlikely that Informix will update the product to handle you particular problem. Note that scholars in France would have bigger problems because of the completely revised calendar in use shortly after the French Revolution; they obviously fell back in line later. No doubt, similar items could be found in many countries. Consequently, IMO, it is not reasonable to expect a generic solution to ancient (in computing terms) calendar problems. Yours, Jonathan Leffler (jleffler@earthlink.net) #include <many-aliases.h>