[Top] [All Lists]

Problem in RFC 5260 - Appendix A

2009-08-17 19:10:57


I've recently implemented the Sieve date extension specified in RFC 5260. One of the date parts available for matching is the 'julian' part. According to the text at page 3 it represents the following:

     "julian"    => the Modified Julian Day, that is, the date
                    expressed as an integer number of days since
                    00:00 UTC on November 17, 1858 (using the Gregorian
                    calendar).  This corresponds to the regular
                    Julian Day minus 2400000.5.  Sample routines to
                    convert to and from modified Julian dates are
                    given in Appendix A.

In a lazy mood, I copied the jday function from Appendix A into my implementation to generate the required Modified Julian Day (MJD). To my surprise this function does not yield the MJD, but rather just the regular Julian Day (rounded up to the nearest integer). So, for the date 17-08-2009 it yields 2455061 in stead of 55060 (at time 00:00:00). The text in Appendix A clearly states that the jday function returns the modified julian day, but apparently it does not. Other than that, the variable 'j' is declared but never used anywhere in the function.

Is an erratum due for RFC 5260, or am I just blabbering nonsense? My expertise on date-time conversions is a bit bleak, but from what I could find on the net, the jday function is not a correct example for date to MJD conversion.



<Prev in Thread] Current Thread [Next in Thread>