From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: encode-time vs decode-time Date: Mon, 29 Jul 2019 12:08:44 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="220991"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 29 18:09:29 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hs8DI-000vNu-Vr for ged-emacs-devel@m.gmane.org; Mon, 29 Jul 2019 18:09:29 +0200 Original-Received: from localhost ([::1]:54872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs8DI-0000jO-0Y for ged-emacs-devel@m.gmane.org; Mon, 29 Jul 2019 12:09:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55667) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs8Cg-0000j4-1t for emacs-devel@gnu.org; Mon, 29 Jul 2019 12:08:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs8Cf-00057i-0E for emacs-devel@gnu.org; Mon, 29 Jul 2019 12:08:49 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hs8Ce-00056i-QK for emacs-devel@gnu.org; Mon, 29 Jul 2019 12:08:48 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B7DB21013C1; Mon, 29 Jul 2019 12:08:47 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 50C90100E7F; Mon, 29 Jul 2019 12:08:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1564416526; bh=fdOyPNH9L9dJ9826WE+zzNx47GD2WSM3VaqME6AbRdY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ocpyrRB9EcqvjmtD0g0EXriMjhyPFY9OAChqpg6290/HT6+cLleCmwV1as1tRybyG bHSFlQmUR/zBYO67w1xUCmdGUHKpJcjpKRUH+eyCS5W5aJxRN7PNAIlxYezmFGCWAc ViwjWsZ42NRaVghu0jsLNPF83Q+I5VpV/y8aHrFJ326kQE0NDCXKsOzIoY3gGOTshy ztbg6TfOoJkLvSKM+WXWhixjUQzryWuen8lQRiEoUqGPqxXDp3XUTNuBtKnZRa75tk 06RTSUwuDeu1ILkKDYhRQy6Ph1FenGdIRzuAe5U+pk1XJR0ZfiTfmPB7Hix4Fs6Rbo Vg97rV1PB+NEQ== Original-Received: from pastel (unknown [216.154.19.233]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0160D120236; Mon, 29 Jul 2019 12:08:45 -0400 (EDT) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 29 Jul 2019 16:12:34 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239004 Archived-At: > I think the pair makes sense on the same level as > {decode,encode}-coding-string does. That is, encoded time is what Emacs > uses internally for most things, and decoded time is pretty close to > what you er find in nature. I think the problem is one of presentation and vocabulary, indeed. I think we should clarify: - "time string", as returned by format-time-string and accepted by parse-time-string. - "decoded time", i.e. a list of the form (SECOND MINUTE HOUR DAY MONTH YEAR IGNORED DST ZONE) I just pushed a patch which defines the `decoded-time` *type*, so we can refer to that precise name in docstrings. - "time counted in seconds" for which we support several representations: a plain number, a list of integers (HIGH LOW USEC PSEC), a pair of integers (NUMERATOR . DENOMINATOR). And part of the confusion for me is that `encode-time` not only encodes time, but can also be used to convert between different representations of "time counted in seconds" (in which case it's not the inverse of decode-time). Stefan