Calendrical calculations are made consistent and straightforward for arithmetic operations if dates are first converted to an ordinal number of days relative to an agreed-upon epoch, in this case the Revised Julian epoch, which was the same as the Gregorian epoch. To find the difference between any two Revised Julian dates, convert both to ordinal day counts and simply subtract. To find a past or future date, convert a given date to an ordinal day count, subtract or add the desired number of days, then convert the result to a Revised Julian date.