[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flaky execution



At  9:34 PM 5/25/94 +0000, Byron Davies wrote:
>REGARDING                Flaky execution
>What's wrong with this code, if anything, or is it something about
>encode-universal-time?
>
>(defun julian-date-to-universal-time (julian-date)
>  (let* ((year (read-from-string (subseq julian-date 0 2)))
>            (days (read-from-string (subseq julian-date 2))))
>    (encode-universal-time 0 0 0 days 1 (if (> year 80)
>                                          (+ year 1900)
>                                          (+ year 2000)) 0)))
>
>This function takes a Julian date as a string YYDDD and converts it to
>universal time.  If I evaluate (julian-date-to-universal-time "90100")
>many times in a loop, I get two different answers.  Most of the time,
>the result is 2848694400, which corresponds to the right day, April 9,
>1990.
>
>Sometimes, however, the result is 18446743950740665216, which back
>translates to April 9 in some year WAY out in the future.  Binding the
>final result and returning it using a VALUES form seems to help on the
>840AV, but not on the Quadra 650.

This is a known bug that will be fixed by the "MCL 2.0.1p1" patch
(a beta of which should be available soon). If you want the fix
before then, ask me for "encode-time-patch".