john gilmore wrote:
Formats are of interest for displaying|printing dates. They are of almost no interest for storing dates, which should be stored as signed integers that specify day counts before and after some epoch origin, giving each day a serial number in the sequence

Oh my! "Should be"? Is there some intrinsic universal factor
that makes it so? Are all those who choose some different
format (many interesting ones have been pointed out already)
somehow "wrong" because they choose a format that works for
them in their business needs?

One of my very first customers was a savings and loan in
Albuquerque that stored mortgate payment dates as positive
numbers if the payment had been made and negative dates if
the payment had not yet come in. Worked for them.

==========================================================



. . . , -2, -1, 0, +1, +2, . . . The obvious epoch origin to use is that for CE and BCE dates, viz., 0000 December 31 of the Gregorian calendar. Other epoch origins can then be supported simply using a table of displacements. Thus, for example, +622 July 19 is the Gregorian date of the epoch origin of the Islamic religious calendar, and one converts a Gregorian day G into an Islamic one H by subtracting 227,015, the Gregorian serial number of this date, from G. Or again, a Julian astronomical day J is obtained from a Gregorian day G by subtracting -1,721,424, the G of -4713 November 24, the epoch origin of the Julian astronomical calendar. Storing multiple date formats is a mug's game. It brings the need for too many conversion routines in train. The canonical reference for all calendrical calculations, which I have mentioned on IBM-MAIN before, is Nachum Dershowitz & Edward M. Reingold. Calendrical computations. Cambridge: Cambridge University Press, 1997. Practices different from the one I have just summarized very briefly are common, but they are indefensible. They are always parochial, different in different milieux and for different natural languages; and they reflect a fatal confusion between external display formats, appropriate for people, and internal arithmetic formats, appropriate for calendrical computations performed by computers.

Pompous nonsense! I find the varieties of storing dates fascinating, and each
one has been chosen for a reason that met some need. Yes, parochial to some
degree. But practical for the moment. Even with your approach there are
choices to make: is there a largest and / or smallest bound? from an astronomical perspective, choosing Earth days is totally parochial. Even the
duration of these changes over time. :-)


John Gilmore Ashland, MA 01721-1817 USA



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to