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

Re: [sieve] Julian date vs. :zone...

2009-09-17 12:21:17
Hello again.

On Thu, Sep 17, 2009 at 06:07:02PM +0200, Hannah Schroeter wrote:
RFC 5260 states

    "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.

Do I understand it right that date-part "julian" ignores any timezones
that way?

According to http://en.wikipedia.org/wiki/Julian_day,
 A Julian date of 2454115.05486 means that the date and Universal Time
 is Sunday January 14, 2007 at 13:18:59.9.
So "julian" for that time would be 54114.55486, truncated down, i.e.
54114? So I could calculate "julian" by using an Unix timestamp,
dividing it by 86400 and adding 39610 to it, without any timestamp
corrections?

Seems I did something wrong. Just checked again and the offset must be
40587.

According to the table there:
  http://en.wikipedia.org/wiki/Julian_day#Alternatives

Unix time (U) is (JD - 2440587.5) * 86400
Modified Julian Day (MJD) is JD - 2400000.5

So U / 86400 = JD - 2440587.5 = MJD + 2400000.5 - 2440587.5 = MJD - 40587,
so MJD = U / 86400 - 40587.

"julian" would be trunc(MJD), if I understand things right and the
timezone doesn't affect the "julian" date-part of RFC 5260.

If one uses large enough (e.g. 64 bit) integers to encode the parsed
date field, together with a timezone offset (for the case if the script
specifies :originalzone), one can use that and generate MJD and other
date-parts from it.

Kind regards,

Hannah.
_______________________________________________
sieve mailing list
sieve(_at_)ietf(_dot_)org
https://www.ietf.org/mailman/listinfo/sieve

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