ietf-mta-filters
[Top] [All Lists]

Re: Problem in RFC 5260 - Appendix A

2009-08-19 17:35:09


Hello,

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.

You're right - the code in the appendix doesn't have the necessary adjustment
in it. (Of course it's a trivial thing to add.)

As to  whether this should be dealt with by an erratum, that's one way, but
perhaps the better alternative is to republish so I can also add the phrase
"code component" to the appendix. That addresses the licensing issues for
reusing code in an RFC.

In any case, thanks for reporting this.

                                Ned

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