Samuel,
There are several ASF projects that could use a robust
implementation of Gregorian Calendar DateTime that
accommodates both (AD) Normal and (BC) Negative Years.
Such an algorithm is essential for mapping calendars of
antiquity to a robust solar time standard algorithm such
as exists in the Gregorian Calendar algorithm.
If we can come up with an algorithm that implements
the Gregorian Calendar datetime functions in C, C++, and
Java  I believe that the resulting code would
be gladly accepted in many of the other ASF projects.
Even the organizations that support the web standards
consortium, will probably be interested in a solid
Gregorian datetime library (http://www.w3.org).
The support of negative Gregorian Calendar Years is
beyond the initial scope of the EXSLT project. If we can
get a proof of concept and documentation for (BC)
datetime computations, I can assist in getting the
results published.
If the EXSLT project only implements (AD) Gregorian
dates of positive years, that would be a big improvement
over what we have!
POSCYCLE (AD) NEGCYCLE (BC)
0001 notleap 0400 notleap Cycle Start Day = 0
0002 notleap 0399 notleap
0003 notleap 0398 notleap
0004 leap 0397 leap
0008 leap 0393 leap
0012 leap 0389 leap
0016 leap 0385 leap
0020 leap 0381 leap
0100 notleap 0301 not leap
0200 notleap 0201 not leap
0300 notleap 0101 not leap
0400 leap 0001 leap Cycle End Day = 146096
Note: Within the NEGCYCLE Gregorian, the months
and days have a monotonic positive sequence whereas
the years have a monotonic negative sequence.
We cannot just perform a negative inverse of everything.
We just create a transposed Gregorian 400 year cycle
and iterate the days and months in a positive manner and
declare only the years as a negative inverse.
Note also that leapyear analysis is done according to
the transposed Gregorian Cycle instead of the numeric
year value.
An analysis of negative years (omitting Year = zero), it is
possible to create a useful algorithm for computing leap
years and leap centuries where Year is in the (BC) range.
Converting Negative or (BC) Years to a useful numeric
for Positive Gregorian Cycle algorithms, just add the
appropriate 401, 801, 1201, 1601, 2001 to the negative
year, and the year result is transformed into a positive
number that is compatible with the simple leapyear
computation
For example: Year 0397, add 0401, result = 4 which is a leap year.
Another example: Year 0201, add 0401, result = 200 which is not a leap
century.
Calendars of antiquity are being positioned on the extrapolated
Gregorian calendar algorithm according to the above rules.
Maintaining the positive daily and monthly numbering also
allows positioning of various religious, secular, and public
festivals in their appropriate season when mapped to the other
calendars.
The Unix "cal" calendar program does not allow negative
years for (BC) computation.
========================================================
  
0800 = cycle start (day = 0)
0797 a leap year
0701 not a leap year
0601 not a leap year
0501 not a leap year
0401 = cycle end (day = 146096) a leap year
  
0400 = cycle start (day = 0) not a leap year
0397 a leap year
0301 not a leap year
0201 not a leap year
0101 not a leap year
0001 = cycle end (day = 146096) a leap year
========<epoc break>=======
0001 = cycle start (day = 0) not a leap year
0004 a leap year
0100 not a leap year
0200 not a leap year
0300 not a leap year
0400 = cycle end (day = 146096) a leap year
  
0401 = cycle start (day = 0)
0404 a leap year
0500 not a leap year
0600 not a leap year
0700 not a leap year
0800 = cycle end (day = 146096) a leap year
  
========================================
Trivia: What year did King Harod die?
Answer: Year 4 (BC) Gregorian Calendar.
Now, how did Rome determine that year 1 of the
Gregorian Calendar was to be the year of the birth
of Jesus, the Christ? (I have no answer.)
Sincerely,
Steven J. Hathaway
Xalan Documentation Project
<shathaway@apache.org>
