From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#25112: 24.5; function to encode time from time string Date: Mon, 5 Dec 2016 13:49:56 -0800 (PST) Message-ID: <62e0bec4-0ffd-49f9-b8be-577c40882399@default> References: <<5b95d9b8-3281-40da-872d-1a98b8a3d1fa@default>> <<83vauyjr3g.fsf@gnu.org>> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480975297 25925 195.159.176.226 (5 Dec 2016 22:01:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Dec 2016 22:01:37 +0000 (UTC) Cc: 25112@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 05 23:01:33 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cE1KG-0005FZ-H1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Dec 2016 23:01:32 +0100 Original-Received: from localhost ([::1]:44590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE1KE-0001VG-6q for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Dec 2016 17:01:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE1AB-0000zL-St for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 16:51:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cE1A6-0003gb-VU for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 16:51:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41979) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cE1A6-0003gO-SR for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 16:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cE1A6-0003ze-Dx for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 16:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2016 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25112 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25112-submit@debbugs.gnu.org id=B25112.148097460815280 (code B ref 25112); Mon, 05 Dec 2016 21:51:02 +0000 Original-Received: (at 25112) by debbugs.gnu.org; 5 Dec 2016 21:50:08 +0000 Original-Received: from localhost ([127.0.0.1]:57378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cE19D-0003yO-UV for submit@debbugs.gnu.org; Mon, 05 Dec 2016 16:50:08 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:19477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cE19C-0003xq-1X for 25112@debbugs.gnu.org; Mon, 05 Dec 2016 16:50:06 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uB5Lnx6j008580 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Dec 2016 21:50:00 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id uB5Lnx7V029624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Dec 2016 21:49:59 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uB5LnvwX023678; Mon, 5 Dec 2016 21:49:58 GMT In-Reply-To: <<83vauyjr3g.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126537 Archived-At: > > Enhancement request: Please add a function that accepts a time > > string and a format spec (to interpret the time string), and > > returns a time value that represents the same time. >=20 > I believe you want either date-to-time or parse-time-string (the > former is just a thin wrapper around the latter). date-to-time is > described in the ELisp manual. Sheesh. Dunno how I missed `date-to-time' in the manual. I read the 3 nodes about dates & times, but clearly I didn't read them well enough. Maybe it would help to mention this direction of conversion after the second paragraph of node `Time of Day', with a cross-reference? And maybe the node named `Time Conversion' should mention something about conversion both directions between strings and times, with cross-references? Anyway, `date-to-time' does what I want (though it seems to give only a 2-element list, at least in the cases I've tried). Its name does NOT seem very good, though. Among other things, either a date or a time can be represented as either a list or a string - neither is inherently only one or the other. It might help to say something like: (current-time-string (date-to-time date-time-string)) =3D date-time-string and (date-to-time (current-time-string date-time-list)) =3D date-time-list Or if these are not always strictly true then at least point out that this is the general idea. E.g., (current-time-string (date-to-time "Sun Nov 27 16:38:38 2016")) =3D "Sun Nov 27 16:38:38 2016" (date-to-time (current-time-string '(22587 31886))) =3D (22587 31886) I will close this bug, in any case. Thx.