Hello!
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?
I'm not entirely clear on what you mean here, but if you're talking about
simply dropping any time zone component before converting to Julian day, then
no, that makes no sense.
Julian day is defined as the integral number of days between *two* points in
time. You're confusing the specification of the time zone for the first - fixed
- one of these points with the specification of the time zone for the second.
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.
And you will note that the results were expressed in terms of a specific
time zone.
So "julian" for that time would be 54114.55486, truncated down, i.e.
54114?
Correct but not especially relevant in the context of handling time zones.
So I could calculate "julian" by using an Unix timestamp,
dividing it by 86400 and adding 39610 to it, without any timestamp
corrections?
I don't know what you mean by "timestamp corrections", but if by "Unix
timestamp" you mean a time_t value expressing the number of seconds since Jan
01 1970 00:00 UTC, then yes, this should get you the modified Julian date.
However, this ignores how you got to that "Unix timestamp" in the first place.
If you did so by incorporating any time zone offset in the original time value
into the calculation, then it's all good. If, however, you simply dropped any
zone information, then the result can be incorrect.
Putting this in terms of standard C library functions, it's the difference
between calling mktime (correct) to get that time_t value and timegm (wrong).
Ned
_______________________________________________
sieve mailing list
sieve(_at_)ietf(_dot_)org
https://www.ietf.org/mailman/listinfo/sieve