GNU bug report logs -
#36549
27.0.50; decode-time doesn't support sub-second times
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Mon, 8 Jul 2019 13:12:02 UTC
Severity: wishlist
Tags: fixed
Found in version 27.0.50
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
(current-time)
=> (23843 16275 300006 490000)
(decode-time '(23843 16275 300006 490000))
=> (23 5 15 8 7 2019 1 t 7200)
(decode-time '(23843 16275 100006 490000))
=> (23 5 15 8 7 2019 1 t 7200)
So there's no way to represent the microseconds (or the picoseconds) in
the decoded time structure, which makes round-tripping inaccurate. (And
you can't build a parser for time formats with sub-second time based on
the decoded time structure, which is a pain.)
I guess the best way to fix this would be to add the micro- and
picoseconds as (optional) fields at the end of the decoded time list?
It's not very elegant, but it'd be backwards compatible. A different
approach would be to make the seconds field something else than an
integer, but that would introduce more potential problems, I think...
In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2019-07-07 built on stories
Repository revision: bda8a57141e6cb5455e1246c6ab394791fd6c582
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 5 years and 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.