back to a Revised Julian date—if the final date differs from the given date then the given date is invalid. This method should also be used to validate any implementation of calendrical arithmetic, by iteratively checking thousands of random and sequential dates for such errors. To convert a Revised Julian date to any other calendar, first convert it to an ordinal day count, and then all that is needed is a function to convert the ordinal days count to that calendar. To convert a date from any other calendar to a Revised Julian date, first convert that calendar date to an ordinal day count, then convert ordinal days to the Revised Julian date. The following constant defined midnight at the start of Revised Julian date Monday, as the beginning of the first ordinal day. This moment was Julian day number 1721425.5. RJepoch = 1 CC3 outlines functions for Gregorian and Julian calendar conversions, as well as many other calendars, always calculating in terms of the ordinal day number, which they call the "fixed date" or rata die (RD), assigning the number 1 to the Gregorian calendar epoch. The arithmetic herein, by using the same ordinal day numbering epoch, is fully compatible with all CC3 functions for calendrical calculations and date inter-conversions. One can assign a different integer to the Revised Julian epoch, for the purpose of numbering ordinal days relative to some other epoch, but if you do so then one must take the epoch difference into account when using any CC3 calendar functions and when converting an ordinal day number to a weekday number. Optionally the ordinal day number can include a fractional component to represent the time as the elapsed fraction of a day. The ordinal day number of the J2000 moment ( noon) was 730120.5. Revised Julian to fixed days Convert a year, month, and day to the corresponding fixed day number: PriorYear = year − 1 FixedDays = RJepoch + 365 × PriorYear + floor(PriorYear / 4) + floor((367 × month − 362) / 12) + day − 1 If month is after February then subtract 1 day for a leap year or subtract 2 days for a common year: IF month > 2 THEN IF isLeapYear(year) THEN FixedDays = FixedDays − 1 ELSE FixedDays = FixedDays − 2 END IF END IF Finally subtract a day for each prior century year (most of which are