all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: 36549@debbugs.gnu.org
Subject: bug#36549: 27.0.50; decode-time doesn't support sub-second times
Date: Mon, 08 Jul 2019 15:10:49 +0200	[thread overview]
Message-ID: <m3muhou0x2.fsf@gnus.org> (raw)


(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






             reply	other threads:[~2019-07-08 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 13:10 Lars Ingebrigtsen [this message]
2019-08-26  5:01 ` bug#36549: 27.0.50; decode-time doesn't support sub-second times Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3muhou0x2.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=36549@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.