That's correct Ed, and WAD. Date('B') is intended for doing reliable date arithmetic, not archeology. :-)

A consistent algorithm is more important to modern programmers than hewing precisely to historical usage (were that even possible, given the multiplicity of calendar schemes used in antiquity). Those who assert that Jesus was born on a Monday have a few other errors to explain first. Usually they are the ones who also delight in the UNIX 'cal 9 1752' special case.

-Chip-

On 1/5/11 15:31 Edward M Martin said:
For BASE there is a note
NOTE:  The base date of 1 January 0001 is determined by extending
       the current Gregorian calendar backward (365 days each
       year, with an extra day every year that is divisible by 4
       except century years that are not divisible by 400). It
       does not take into account any errors in the calendar
       system that created the Gregorian calendar originally.

-----Original Message-----
From: Chip Davis
So the best option is to simply forget about the Date('C') option in the first place and use Date('B') instead. If you have existing code that you need to convert, you can establish the Date('C') epoch as a constant (now 730119) offset to the Date('B') value.

On 1/4/11 22:25 Schuh, Richard said:
It is right with the DATE(B) function - 01/01/1001.
All the technicalities aside, forget about the word "Century" and view

the letter "C" as an abstraction for the described function. Then, everything is consistent, even if technically incorrect.

    *From:* *George Henke/NYLIC*
    tyvm, Chip, for the explanation.  So this century really began in
    Jan 1, 2001, not 2000.  Interesting.

    *From:* *Chip Davis <c...@aresti.com>*
    Technically, the first year of each century is cc01, not cc00.

    On 1/3/11 16:03 George Henke/NYLIC said:
     > Not quite sure what is the difference between the number of
days
    since
     > the beginning of the century and the number of days since the
most
     > recent year ending in '00' unless going back or ahead more than
a
     > century or 2.
     >
     > But I suppose there is a difference or it would have been moot.
     >
     > *Chip Davis <c...@aresti.com>*
     > Be careful with Date('C').  It doesn't really give you the
number of
     > days in the current century (as it was originally documented).
It
     > returns the number of days since the beginning of the most
recent
    year
     > ending in '00', e.g. '2000'.
     >
     > On 1/3/11 14:25 George Henke/NYLIC said:
     >  > REXX also has a nifty function called Century Day that
    simplifies things
     >  > by working in century days, days since the beginning of the
    century,
     >  > rather than days since the beginning of the year.

Reply via email to