From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs Subject: bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates Date: Thu, 30 Dec 2021 00:32:49 -0500 Message-ID: <25037.17537.313178.136412@orion.rgrjr.com> References: <7c22f300-eedb-da65-db02-e82025ec2f48@cs.ucla.edu> <25023.40959.627321.685762@orion.rgrjr.com> <875yrjpp03.fsf@gnus.org> <25024.42989.718735.680188@orion.rgrjr.com> <871r26i5n0.fsf@gnus.org> <25028.53876.304365.706795@orion.rgrjr.com> <87zgoq2vwm.fsf@gnus.org> <25029.60989.564217.290743@orion.rgrjr.com> <87bl1428x5.fsf@gnus.org> <25031.40994.286546.498819@orion.rgrjr.com> <87ee5zzjpg.fsf@gnus.org> <25035.12991.328986.987982@orion.rgrjr.com> <87o84z782g.fsf@gnus.org> <25036.55965.149104.938898@orion.rgrjr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cNrU+IIpKv" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17635"; mail-complaints-to="usenet@ciao.gmane.io" To: Paul Eggert , Lars Ingebrigtsen , 52209@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 30 06:33:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n2o3w-0004Qc-5c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 06:33:16 +0100 Original-Received: from localhost ([::1]:44494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2o3u-00013R-8d for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 00:33:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2o3i-000138-Ar for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 00:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2o3i-0005WC-0h for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 00:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2o3h-0002YW-VS for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 00:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bob Rogers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Dec 2021 05:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52209-submit@debbugs.gnu.org id=B52209.16408423769811 (code B ref 52209); Thu, 30 Dec 2021 05:33:01 +0000 Original-Received: (at 52209) by debbugs.gnu.org; 30 Dec 2021 05:32:56 +0000 Original-Received: from localhost ([127.0.0.1]:50893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2o3c-0002YB-8U for submit@debbugs.gnu.org; Thu, 30 Dec 2021 00:32:56 -0500 Original-Received: from rgrjr.com ([69.164.211.47]:39408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2o3Y-0002Xz-0y for 52209@debbugs.gnu.org; Thu, 30 Dec 2021 00:32:54 -0500 Original-Received: from rgrjr.com (c-73-16-206-7.hsd1.ma.comcast.net [73.16.206.7]) by rgrjr.com (Postfix on openSUSE) with ESMTP id 186471D6BB2; Thu, 30 Dec 2021 05:33:04 +0000 (UTC) Original-Received: from orion.rgrjr.com (orion.rgrjr.com [192.168.0.3]) by scorpio.rgrjr.com (Postfix on openSUSE GNU/Linux) with ESMTP id 5D7785FE2E; Thu, 30 Dec 2021 00:32:51 -0500 (EST) In-Reply-To: <25036.55965.149104.938898@orion.rgrjr.com> X-Mailer: VM 7.19 under Emacs 29.0.50 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223411 Archived-At: --cNrU+IIpKv Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit From: Bob Rogers Date: Wed, 29 Dec 2021 17:01:01 -0500 From: Paul Eggert Date: Wed, 29 Dec 2021 11:29:44 -0800 * I suggest preferring the symbol 'rfc-email' for parsing email-related dates, for consistency with the --rfc-email option of GNU 'date'. This should use the current RFC (5322 now, perhaps updated later). The only update I saw at https://www.rfc-editor.org (RFC6854) only affects addressing syntax. I started with RFC822 and RFC2822 because I had copies of these lying around; you're right that I should have looked for more recent standards. And using rfc-email as a synonym for the latest version is a good idea. FYI, there is no substantial difference between RFC2822 and RFC5322 in date/time syntax. They hide the whitespace in different productions, but the end result is the same. So I'll change the format name to rfc5322 and add rfc-email as a synonym. -- Bob --cNrU+IIpKv Content-Type: text/x-patch Content-Description: Content-Disposition: inline; filename="email-date-spec-changes.patch" Content-Transfer-Encoding: 7bit --- rfc2822-date.text 2021-12-30 00:15:38.588023882 -0500 +++ rfc5322-date.text 2021-12-29 23:41:39.492629354 -0500 @@ -1,15 +1,15 @@ 3.3. Date and Time Specification - Date and time occur in several header fields. This section + Date and time values occur in several header fields. This section specifies the syntax for a full date and time specification. Though folding white space is permitted throughout the date-time specification, it is RECOMMENDED that a single space be used in each place that FWS appears (whether it is required or optional); some older - implementations may not interpret other occurrences of folding white + implementations will not interpret longer sequences of folding white space correctly. - date-time = [ day-of-week "," ] date FWS time [CFWS] + date-time = [ day-of-week "," ] date time [CFWS] day-of-week = ([FWS] day-name) / obs-day-of-week @@ -18,17 +18,15 @@ date = day month year - day = ([FWS] 1*2DIGIT) / obs-day + day = ([FWS] 1*2DIGIT FWS) / obs-day - month = (FWS month-name FWS) / obs-month - - month-name = "Jan" / "Feb" / "Mar" / "Apr" / + month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec" - year = 4*DIGIT / obs-year + year = (FWS 4*DIGIT FWS) / obs-year - time = time-of-day FWS zone + time = time-of-day zone time-of-day = hour ":" minute [ ":" second ] @@ -38,7 +36,7 @@ second = 2DIGIT / obs-second - zone = (( "+" / "-" ) 4DIGIT) / obs-zone + zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone The day is the numeric day of the month. The year is any numeric year 1900 or later. @@ -54,28 +52,27 @@ day is ahead of (i.e., east of) or behind (i.e., west of) Universal Time. The first two digits indicate the number of hours difference from Universal Time, and the last two digits indicate the number of - minutes difference from Universal Time. (Hence, +hhmm means + additional minutes difference from Universal Time. (Hence, +hhmm means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm) minutes). The form "+0000" SHOULD be used to indicate a time zone at Universal Time. Though "-0000" also indicates Universal Time, it is used to indicate that the time was generated on a system that may be in a local - time zone other than Universal Time and therefore indicates that the - date-time contains no + time zone other than Universal Time and that the date-time contains no information about the local time zone. A date-time specification MUST be semantically valid. That is, the - day-of-the-week (if included) MUST be the day implied by the date, the + day-of-week (if included) MUST be the day implied by the date, the numeric day-of-month MUST be between 1 and the number of days allowed for the specified month (in the specified year), the time-of-day MUST be in the range 00:00:00 through 23:59:60 (the number of seconds - allowing for a leap second; see [STD12]), and the zone MUST be within - the range -9959 through +9959. + allowing for a leap second; see [RFC1305]), and the last two digits of + the zone MUST be within the range 00 through 59. 4.3. Obsolete Date and Time The syntax for the obsolete date format allows a 2 digit year in the - date field and allows for a list of alphabetic time zone specifications - that were used in earlier versions of this standard. It also + date field and allows for a list of alphabetic time zone specifiers + that were used in earlier versions of this specification. It also permits comments and folding white space between many of the tokens. obs-day-of-week = [CFWS] day-name [CFWS] @@ -138,3 +135,8 @@ and "Z" is equivalent to "+0000". However, because of the error in [RFC0822], they SHOULD all be considered equivalent to "-0000" unless there is out-of-band information confirming their meaning. + + Other multi-character (usually between 3 and 5) alphabetic time zones + have been used in Internet messages. Any such time zone whose meaning + is not known SHOULD be considered equivalent to "-0000" unless there is + out-of-band information confirming their meaning. --cNrU+IIpKv--