From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#21903: date->string duff ISO 8601 negative years Date: Sat, 20 Oct 2018 18:33:31 -0400 Message-ID: <87lg6s2qpw.fsf@netris.org> References: <20151113140157.GN13455@fysh.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540074726 1393 195.159.176.226 (20 Oct 2018 22:32:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2018 22:32:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 21903@debbugs.gnu.org To: Zefram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Oct 21 00:32:02 2018 Return-path: Envelope-to: guile-bugs@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 1gDzmr-0000Fz-QN for guile-bugs@m.gmane.org; Sun, 21 Oct 2018 00:32:01 +0200 Original-Received: from localhost ([::1]:56781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDzoy-0005Zl-8i for guile-bugs@m.gmane.org; Sat, 20 Oct 2018 18:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDzos-0005Ze-Kg for bug-guile@gnu.org; Sat, 20 Oct 2018 18:34:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDzoo-0002qu-KX for bug-guile@gnu.org; Sat, 20 Oct 2018 18:34:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDzoo-0002qo-E5 for bug-guile@gnu.org; Sat, 20 Oct 2018 18:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gDzoo-0001iH-AA for bug-guile@gnu.org; Sat, 20 Oct 2018 18:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 20 Oct 2018 22:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21903 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 21903-submit@debbugs.gnu.org id=B21903.15400748306568 (code B ref 21903); Sat, 20 Oct 2018 22:34:02 +0000 Original-Received: (at 21903) by debbugs.gnu.org; 20 Oct 2018 22:33:50 +0000 Original-Received: from localhost ([127.0.0.1]:33573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDzoc-0001hr-5A for submit@debbugs.gnu.org; Sat, 20 Oct 2018 18:33:50 -0400 Original-Received: from world.peace.net ([64.112.178.59]:35552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDzob-0001hf-8t for 21903@debbugs.gnu.org; Sat, 20 Oct 2018 18:33:49 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDzoV-0000As-Ab; Sat, 20 Oct 2018 18:33:43 -0400 In-Reply-To: <20151113140157.GN13455@fysh.org> (Zefram's message of "Fri, 13 Nov 2015 14:01:57 +0000") 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-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9221 Archived-At: Zefram writes: > The date->string function from (srfi srfi-19), used on ISO 8601 formats > "~1", "~4" and "~5", for years preceding AD 1, has an off-by-one error: > > scheme@(guile-user)> (use-modules (srfi srfi-19)) > scheme@(guile-user)> (date->string (julian-day->date 0 0) "~4") > $1 = "-4714-11-24T12:00:00Z" > > The date in question, the JD epoch, is 24 November 4714 BC (in the > proleptic Gregorian calendar). In ISO 8601 format, that year is properly > represented as "-4713", not "-4714", because ISO 8601 uses the AD era > exclusively. 4714 BC = AD -4713. I agree that this is definitely a bug, but I'm nervous about deviating from the SRFI-19 reference implementation, and therefore probably from most other implementations of SRFI-19, in this way. I think that this bug should be reported to the SRFI-19 mailing list. https://srfi.schemers.org/srfi-19/ There have been several other bugs reported and fixed in upstream SRFI-19 over the years, including some as recently as June 2017, so I'm hopeful that they will take this bug seriously and issue a fix. Would you like to report it to them? Mark