From unknown Sat Sep 06 03:34:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39001: parse-time-string fails to parse Info node's example Resent-From: mark skilbeck Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2020 06:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39001 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 39001@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157837688030250 (code B ref -1); Tue, 07 Jan 2020 06:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jan 2020 06:01:20 +0000 Received: from localhost ([127.0.0.1]:47170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iohvc-0007rq-2e for submit@debbugs.gnu.org; Tue, 07 Jan 2020 01:01:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:33908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iohvZ-0007ri-Qa for submit@debbugs.gnu.org; Tue, 07 Jan 2020 01:01:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59845) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iohvX-0003IO-AO for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 01:01:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iohvW-0005UY-0P for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 01:01:14 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:38346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iohvV-0005Tt-Nb for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 01:01:13 -0500 Received: by mail-lj1-x22f.google.com with SMTP id w1so31451200ljh.5 for ; Mon, 06 Jan 2020 22:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=u+9zI/GdOhy0ykvo/gfhzLQwS0Kotso3jag64AnYwoA=; b=biL4r0vJpCNtTyZ/Rkvl5Pr60sN2UKnmh+CRXT1dPUa7yMfN0dJ+s2/Gp06ip7EW6r SotzE2PjY8qYe5XJFaZjjUcLDDZximNjBzQs1ZKaJGUDWnnJAF6+u0l5vN0v07lLyMp9 OGhOdw9Y8tFopy/64Eipf1ScdHIEsEuV2In/M/7jFOP7/zGjc138QWBT8yDi0lmKfPz+ goWg6BheNN54ZxpOWNPqeb34zhPJIcQWFScBXuyUePVF1bntyE+ueVMDpqPvYZ3pNyMp NRsUvwtRGDNC7cTNUMKNIuVY+GGrbf+ZlRfXqfuhGCq9LCUCLZcGRl0bP2Ye0WmQf4Zs epwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=u+9zI/GdOhy0ykvo/gfhzLQwS0Kotso3jag64AnYwoA=; b=IJ7f1wZVl+5TTITJwTsNXiThY8D1H6wQymcFRz/21KRaIF/Gbq/nwMOctIQoAtFh0j 3D/oXItHOloKL0edY5//s/eAurfhGDN1EhulUtPNGvkmeCv1PKJ1BX7ZUqFEi46DkNUO UOdZLMKADeDlfhd0mNEPby8tOxrML2hARLNWOA3FPjKokOACEb8vMZTdC9HVb18P7lsI HyHnSNBOHvGQ6eJAxiiVEwm/k5NupZXjCGVUd38I/AHlEWGy2L0VbtQ9cKbBti0gLgt6 brCpYyUFgOU5g91RuRxqEKlElZtJYm/V/fMQf+L8hlCntQQClHK5Ujk0B6ZaPMJpgB67 kVbw== X-Gm-Message-State: APjAAAXg4qOiTr4RnblLOj8faEZCctlnRZ3lI+nR2ZcHslAxwt8InGri i064LvKrn0ClvuXEIPYahqQvjA+MFArq/mS9R1fzyTRfbkU= X-Google-Smtp-Source: APXvYqyzJYTGk0aZ8Z5As/AdCUmkmIUYWtXMAGSEPcD9MvgfpysWpG0v4WHJ1xwMw1tXXF5wZUWt4nkLzx2YJNZxl7o= X-Received: by 2002:a2e:80cc:: with SMTP id r12mr208099ljg.154.1578376871575; Mon, 06 Jan 2020 22:01:11 -0800 (PST) MIME-Version: 1.0 From: mark skilbeck Date: Mon, 6 Jan 2020 22:01:00 -0800 Message-ID: Content-Type: multipart/alternative; boundary="000000000000c085e1059b868034" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22f X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000c085e1059b868034 Content-Type: text/plain; charset="UTF-8" The info node (elisp) Time Parsing suggests that the string "1998-09-12T12:21:54-0200" should be of a format that `parse-time-string` can successfully parse. However, trying to do so produces no useful info from parsing (it returns a list of NILs). GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.5.0, Carbon Version 158 AppKit 1671.4) of 2019-08-29 --000000000000c085e1059b868034 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The info node (elisp) Time Parsing suggests that the = string "1998-09-12T12:21:54-0200" should be of a format that `par= se-time-string` can successfully parse. However, trying to do so produces n= o useful info from parsing (it returns a list of NILs).

GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.5.0, Carbon Version 15= 8 AppKit 1671.4) of 2019-08-29
--000000000000c085e1059b868034-- From unknown Sat Sep 06 03:34:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: mark skilbeck Subject: bug#39001: closed (Re: parse-time-string fails to parse Info node's example) Message-ID: References: <1d6510ff-910a-8294-09a1-1b9c6f2ce5ed@cs.ucla.edu> X-Gnu-PR-Message: they-closed 39001 X-Gnu-PR-Package: emacs Reply-To: 39001@debbugs.gnu.org Date: Thu, 16 Jan 2020 01:46:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1579139162-9325-1" This is a multi-part message in MIME format... ------------=_1579139162-9325-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #39001: parse-time-string fails to parse Info node's example which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 39001@debbugs.gnu.org. --=20 39001: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D39001 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1579139162-9325-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 39001-done) by debbugs.gnu.org; 16 Jan 2020 01:45:13 +0000 Received: from localhost ([127.0.0.1]:36538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iruDg-0002PG-Tc for submit@debbugs.gnu.org; Wed, 15 Jan 2020 20:45:13 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iruDe-0002Ox-Lc for 39001-done@debbugs.gnu.org; Wed, 15 Jan 2020 20:45:11 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 91B15160072; Wed, 15 Jan 2020 17:45:04 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id g_12mUuXe8ev; Wed, 15 Jan 2020 17:45:03 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 681A9160081; Wed, 15 Jan 2020 17:45:03 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 70AfckZ58foN; Wed, 15 Jan 2020 17:45:03 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4709D160072; Wed, 15 Jan 2020 17:45:03 -0800 (PST) To: mark skilbeck From: Paul Eggert Subject: Re: parse-time-string fails to parse Info node's example Organization: UCLA Computer Science Department Message-ID: <1d6510ff-910a-8294-09a1-1b9c6f2ce5ed@cs.ucla.edu> Date: Wed, 15 Jan 2020 17:45:02 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1B88AEAAE29D19D80D64FD87" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 39001-done Cc: 39001-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is a multi-part message in MIME format. --------------1B88AEAAE29D19D80D64FD87 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the bug report. I fixed the code so that it matches the documentation by installing the attached patches into Emacs master. The first patch is the fix, the second is merely refactoring. --------------1B88AEAAE29D19D80D64FD87 Content-Type: text/x-patch; charset=UTF-8; name="0001-parse-time-string-now-parses-ISO-8601-format-strings.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-parse-time-string-now-parses-ISO-8601-format-strings.pa"; filename*1="tch" >From 33d9ca387824e050650b49a60083e4e4cb4e3d11 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 15 Jan 2020 17:36:59 -0800 Subject: [PATCH 1/2] parse-time-string now parses ISO 8601 format strings * lisp/calendar/parse-time.el (parse-time-string): Parse strings in ISO 8601 format too (Bug#39001). (parse-time--rfc-822ish): New internal function, containing most of the old parse-time-string implementation. (parse-iso8601-time-string): Simplify, now that parse-time-string groks ISO 8601. --- etc/NEWS | 3 +++ lisp/calendar/parse-time.el | 25 ++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 0e43c321d8..3d5915a377 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -70,6 +70,9 @@ called when the function object is garbage-collected. Use 'set_function_finalizer' to set the finalizer and 'get_function_finalizer' to retrieve it. +** 'parse-time-string' can now parse ISO 8601 format strings, +such as "2020-01-15T16:12:21-08:00". + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 7110a81f0d..4d4f88efff 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -149,13 +149,20 @@ parse-time-rules ;;;###autoload (defun parse-time-string (string) "Parse the time in STRING into (SEC MIN HOUR DAY MON YEAR DOW DST TZ). -STRING should be something resembling an RFC 822 (or later) date-time, e.g., -\"Fri, 25 Mar 2016 16:24:56 +0100\", but this function is +STRING should be an ISO 8601 time string, e.g., \"2020-01-15T16:12:21-08:00\", +or something resembling an RFC 822 (or later) date-time, e.g., +\"Wed, 15 Jan 2020 16:12:21 -0800\". This function is somewhat liberal in what format it accepts, and will attempt to return a \"likely\" value even for somewhat malformed strings. The values returned are identical to those of `decode-time', but any unknown values other than DST are returned as nil, and an unknown DST value is returned as -1." + (condition-case () + (decoded-time-set-defaults (iso8601-parse string)) + (wrong-type-argument + (parse-time--rfc-822ish string)))) + +(defun parse-time--rfc-822ish (string) (let ((time (list nil nil nil nil nil nil nil -1 nil)) (temp (parse-time-tokenize (downcase string)))) (while temp @@ -196,15 +203,11 @@ parse-time-string time)) (defun parse-iso8601-time-string (date-string) - "Parse an ISO 8601 time string, such as 2016-12-01T23:35:06-05:00. -If DATE-STRING cannot be parsed, it falls back to -`parse-time-string'." - (when-let ((time - (if (iso8601-valid-p date-string) - (decoded-time-set-defaults (iso8601-parse date-string)) - ;; Fall back to having `parse-time-string' do fancy - ;; things for us. - (parse-time-string date-string)))) + "Parse an ISO 8601 time string, such as \"2020-01-15T16:12:21-08:00\". +Fall back on parsing something resembling an RFC 822 (or later) date-time. +This function is like `parse-time-string' except that it returns +a Lisp timestamp when successful." + (when-let ((time (parse-time-string date-string))) (encode-time time))) (provide 'parse-time) -- 2.24.1 --------------1B88AEAAE29D19D80D64FD87 Content-Type: text/x-patch; charset=UTF-8; name="0002-Refactor-parse-time-string.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Refactor-parse-time-string.patch" >From d3db908ffbfa17ff74080455ac0520c663f920ee Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 15 Jan 2020 17:41:42 -0800 Subject: [PATCH 2/2] Refactor parse-time-string * lisp/calendar/parse-time.el (parse-time--rfc-822ish): Remove, and fold its body into its only caller. --- lisp/calendar/parse-time.el | 79 ++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 4d4f88efff..6a4612297c 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -160,47 +160,44 @@ parse-time-string (condition-case () (decoded-time-set-defaults (iso8601-parse string)) (wrong-type-argument - (parse-time--rfc-822ish string)))) - -(defun parse-time--rfc-822ish (string) - (let ((time (list nil nil nil nil nil nil nil -1 nil)) - (temp (parse-time-tokenize (downcase string)))) - (while temp - (let ((parse-time-elt (pop temp)) - (rules parse-time-rules) - (exit nil)) - (while (and rules (not exit)) - (let* ((rule (pop rules)) - (slots (pop rule)) - (predicate (pop rule)) - (parse-time-val)) - (when (and (not (nth (car slots) time)) ;not already set - (setq parse-time-val - (cond ((and (consp predicate) - (not (functionp predicate))) - (and (numberp parse-time-elt) - (<= (car predicate) parse-time-elt) - (or (not (cdr predicate)) - (<= parse-time-elt - (cadr predicate))) - parse-time-elt)) - ((symbolp predicate) - (cdr (assoc parse-time-elt - (symbol-value predicate)))) - ((funcall predicate))))) - (setq exit t) - (while slots - (let ((new-val (if rule - (let ((this (pop rule))) - (if (vectorp this) - (cl-parse-integer - parse-time-elt - :start (aref this 0) - :end (aref this 1)) - (funcall this))) - parse-time-val))) - (setf (nth (pop slots) time) new-val)))))))) - time)) + (let ((time (list nil nil nil nil nil nil nil -1 nil)) + (temp (parse-time-tokenize (downcase string)))) + (while temp + (let ((parse-time-elt (pop temp)) + (rules parse-time-rules) + (exit nil)) + (while (and rules (not exit)) + (let* ((rule (pop rules)) + (slots (pop rule)) + (predicate (pop rule)) + (parse-time-val)) + (when (and (not (nth (car slots) time)) ;not already set + (setq parse-time-val + (cond ((and (consp predicate) + (not (functionp predicate))) + (and (numberp parse-time-elt) + (<= (car predicate) parse-time-elt) + (or (not (cdr predicate)) + (<= parse-time-elt + (cadr predicate))) + parse-time-elt)) + ((symbolp predicate) + (cdr (assoc parse-time-elt + (symbol-value predicate)))) + ((funcall predicate))))) + (setq exit t) + (while slots + (let ((new-val (if rule + (let ((this (pop rule))) + (if (vectorp this) + (cl-parse-integer + parse-time-elt + :start (aref this 0) + :end (aref this 1)) + (funcall this))) + parse-time-val))) + (setf (nth (pop slots) time) new-val)))))))) + time)))) (defun parse-iso8601-time-string (date-string) "Parse an ISO 8601 time string, such as \"2020-01-15T16:12:21-08:00\". -- 2.24.1 --------------1B88AEAAE29D19D80D64FD87-- ------------=_1579139162-9325-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Jan 2020 06:01:20 +0000 Received: from localhost ([127.0.0.1]:47170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iohvc-0007rq-2e for submit@debbugs.gnu.org; Tue, 07 Jan 2020 01:01:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:33908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iohvZ-0007ri-Qa for submit@debbugs.gnu.org; Tue, 07 Jan 2020 01:01:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59845) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iohvX-0003IO-AO for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 01:01:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iohvW-0005UY-0P for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 01:01:14 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:38346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iohvV-0005Tt-Nb for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 01:01:13 -0500 Received: by mail-lj1-x22f.google.com with SMTP id w1so31451200ljh.5 for ; Mon, 06 Jan 2020 22:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=u+9zI/GdOhy0ykvo/gfhzLQwS0Kotso3jag64AnYwoA=; b=biL4r0vJpCNtTyZ/Rkvl5Pr60sN2UKnmh+CRXT1dPUa7yMfN0dJ+s2/Gp06ip7EW6r SotzE2PjY8qYe5XJFaZjjUcLDDZximNjBzQs1ZKaJGUDWnnJAF6+u0l5vN0v07lLyMp9 OGhOdw9Y8tFopy/64Eipf1ScdHIEsEuV2In/M/7jFOP7/zGjc138QWBT8yDi0lmKfPz+ goWg6BheNN54ZxpOWNPqeb34zhPJIcQWFScBXuyUePVF1bntyE+ueVMDpqPvYZ3pNyMp NRsUvwtRGDNC7cTNUMKNIuVY+GGrbf+ZlRfXqfuhGCq9LCUCLZcGRl0bP2Ye0WmQf4Zs epwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=u+9zI/GdOhy0ykvo/gfhzLQwS0Kotso3jag64AnYwoA=; b=IJ7f1wZVl+5TTITJwTsNXiThY8D1H6wQymcFRz/21KRaIF/Gbq/nwMOctIQoAtFh0j 3D/oXItHOloKL0edY5//s/eAurfhGDN1EhulUtPNGvkmeCv1PKJ1BX7ZUqFEi46DkNUO UOdZLMKADeDlfhd0mNEPby8tOxrML2hARLNWOA3FPjKokOACEb8vMZTdC9HVb18P7lsI HyHnSNBOHvGQ6eJAxiiVEwm/k5NupZXjCGVUd38I/AHlEWGy2L0VbtQ9cKbBti0gLgt6 brCpYyUFgOU5g91RuRxqEKlElZtJYm/V/fMQf+L8hlCntQQClHK5Ujk0B6ZaPMJpgB67 kVbw== X-Gm-Message-State: APjAAAXg4qOiTr4RnblLOj8faEZCctlnRZ3lI+nR2ZcHslAxwt8InGri i064LvKrn0ClvuXEIPYahqQvjA+MFArq/mS9R1fzyTRfbkU= X-Google-Smtp-Source: APXvYqyzJYTGk0aZ8Z5As/AdCUmkmIUYWtXMAGSEPcD9MvgfpysWpG0v4WHJ1xwMw1tXXF5wZUWt4nkLzx2YJNZxl7o= X-Received: by 2002:a2e:80cc:: with SMTP id r12mr208099ljg.154.1578376871575; Mon, 06 Jan 2020 22:01:11 -0800 (PST) MIME-Version: 1.0 From: mark skilbeck Date: Mon, 6 Jan 2020 22:01:00 -0800 Message-ID: Subject: parse-time-string fails to parse Info node's example To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000c085e1059b868034" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22f X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000c085e1059b868034 Content-Type: text/plain; charset="UTF-8" The info node (elisp) Time Parsing suggests that the string "1998-09-12T12:21:54-0200" should be of a format that `parse-time-string` can successfully parse. However, trying to do so produces no useful info from parsing (it returns a list of NILs). GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.5.0, Carbon Version 158 AppKit 1671.4) of 2019-08-29 --000000000000c085e1059b868034 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The info node (elisp) Time Parsing suggests that the = string "1998-09-12T12:21:54-0200" should be of a format that `par= se-time-string` can successfully parse. However, trying to do so produces n= o useful info from parsing (it returns a list of NILs).

GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.5.0, Carbon Version 15= 8 AppKit 1671.4) of 2019-08-29
--000000000000c085e1059b868034-- ------------=_1579139162-9325-1-- From unknown Sat Sep 06 03:34:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39001: closed (Re: parse-time-string fails to parse Info node's example) Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jan 2020 02:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39001 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert Cc: 39001@debbugs.gnu.org, mark skilbeck Received: via spool by 39001-submit@debbugs.gnu.org id=B39001.157914089212105 (code B ref 39001); Thu, 16 Jan 2020 02:15:01 +0000 Received: (at 39001) by debbugs.gnu.org; 16 Jan 2020 02:14:52 +0000 Received: from localhost ([127.0.0.1]:36565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irugN-00039A-OM for submit@debbugs.gnu.org; Wed, 15 Jan 2020 21:14:51 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:42262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irugL-00038y-Ti for 39001@debbugs.gnu.org; Wed, 15 Jan 2020 21:14:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2LazsYufkkp5Qo11qqOrjR421ruTEwBQaFPoWWaNZcc=; b=ffaMuqNrAZc5rKqCQIgpjiQ9jv XpGdK3vhmvhTmpOKCalra6ksHUg6Ofkvk5vaLAfeH010PoYQyvu4r3NbPXMDG1B3uyxHcXtUNxWIw zyVttaMY7NNisZAiq51gM95eAM+eL/2uJ7PZiCnJ/7GLypWnEpvcvh/0BTR8+Y2lAEOi9jhzT03ZI m1mjeMcdiU4Wd09AEcKQNuFaB5/sxw5lPS/5ihA1R0JlImQLTBbH9IUT7152zwQXU5zENQhxN0/fI 7n7TiQtN+z4teeuiUOGN00KGCh/Ol5J083UDpMzrjNiGuuQTvGpf+fJkdzZCWj0rc1k0HQBMMuD43 waN+Jn9A==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:38334 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1irugG-001Ig4-5y; Wed, 15 Jan 2020 21:14:44 -0500 From: Stefan Kangas In-Reply-To: (GNU bug Tracking System's message of "Thu, 16 Jan 2020 01:46:02 +0000") References: <1d6510ff-910a-8294-09a1-1b9c6f2ce5ed@cs.ucla.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Thu, 16 Jan 2020 03:14:42 +0100 Message-ID: <875zhcywod.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Paul Eggert writes: > Thanks for the bug report. I fixed the code so that it matches the documentation > by installing the attached patches into Emacs master. The first patch is the > fix, the second is merely refactoring. There's a test suite in test/lisp/calendar/parse-time-tests.el Perhaps we should add a test or two there? Best regards, Stefan Kangas From unknown Sat Sep 06 03:34:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39001: parse-time-string fails to parse Info node's example Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jan 2020 02:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39001 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Kangas Cc: 39001@debbugs.gnu.org, mark skilbeck Received: via spool by 39001-submit@debbugs.gnu.org id=B39001.157914122612648 (code B ref 39001); Thu, 16 Jan 2020 02:21:02 +0000 Received: (at 39001) by debbugs.gnu.org; 16 Jan 2020 02:20:26 +0000 Received: from localhost ([127.0.0.1]:36569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irulm-0003Hw-Dz for submit@debbugs.gnu.org; Wed, 15 Jan 2020 21:20:26 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irulk-0003Hi-MM for 39001@debbugs.gnu.org; Wed, 15 Jan 2020 21:20:25 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BD02C160072; Wed, 15 Jan 2020 18:20:18 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id sWt_dkf2xDsQ; Wed, 15 Jan 2020 18:20:18 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2017C160081; Wed, 15 Jan 2020 18:20:18 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id A1N7HmbZB0wO; Wed, 15 Jan 2020 18:20:18 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 01B25160072; Wed, 15 Jan 2020 18:20:18 -0800 (PST) References: <1d6510ff-910a-8294-09a1-1b9c6f2ce5ed@cs.ucla.edu> <875zhcywod.fsf@marxist.se> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <4f39e03c-430e-9d39-5869-3ffece256676@cs.ucla.edu> Date: Wed, 15 Jan 2020 18:20:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <875zhcywod.fsf@marxist.se> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 1/15/20 6:14 PM, Stefan Kangas wrote: > Perhaps we should add a test or two there? Yes, please go ahead.