bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#49017: 28.0.50; fractions in iso8601-parse-time sometimes off


From: Lars Ingebrigtsen
Subject: bug#49017: 28.0.50; fractions in iso8601-parse-time sometimes off
Date: Mon, 14 Jun 2021 15:33:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"J.P." <jp@neverwas.me> writes:

> I think the function `iso8601-parse-time' may be giving questionable
> output when fed a string containing fractional seconds.
>
>   (car (iso8601-parse-time "10:20:30.000001" t))
>     ⇒ (301 . 10)
>
>   ;; (30000001 . 1000000) ; expected
>
> I've attempted a fix by taking the dumbest possible route, but it may be
> too dumb for the likes of Emacs (or just plain wrong). If that's the
> case, please forgive. Thanks.

:-)

It was almost perfect -- but didn't handle the case of trailing zeroes
correctly.  That is, it would give different results for these two:

(iso8601-parse-time "10:20:30.000001" t)
(iso8601-parse-time "10:20:30.000001000" t)

I've now pushed a fix based on your patch to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]