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#22034: time-utc->date shows bogus zone-dependent leap second Date: Sat, 20 Oct 2018 17:42:02 -0400 Message-ID: <87a7n847o5.fsf@netris.org> References: <20151127195146.GB28472@fysh.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540071666 19719 195.159.176.226 (20 Oct 2018 21:41:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2018 21:41:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 22034-done@debbugs.gnu.org To: Zefram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Oct 20 23:41: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 1gDyzV-00051k-J7 for guile-bugs@m.gmane.org; Sat, 20 Oct 2018 23:41:01 +0200 Original-Received: from localhost ([::1]:56645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDz1c-0000Bt-89 for guile-bugs@m.gmane.org; Sat, 20 Oct 2018 17:43:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDz1W-0000B7-PN for bug-guile@gnu.org; Sat, 20 Oct 2018 17:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDz1S-0002rd-Pk for bug-guile@gnu.org; Sat, 20 Oct 2018 17:43:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDz1S-0002rI-JF for bug-guile@gnu.org; Sat, 20 Oct 2018 17:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gDz1S-0006uD-Cb for bug-guile@gnu.org; Sat, 20 Oct 2018 17:43:02 -0400 Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Sat, 20 Oct 2018 21:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 22034 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 22034@debbugs.gnu.org, mhw@netris.org, zefram@fysh.org Original-Received: via spool by 22034-done@debbugs.gnu.org id=D22034.154007174226492 (code D ref 22034); Sat, 20 Oct 2018 21:43:02 +0000 Original-Received: (at 22034-done) by debbugs.gnu.org; 20 Oct 2018 21:42:22 +0000 Original-Received: from localhost ([127.0.0.1]:33524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDz0o-0006tD-IC for submit@debbugs.gnu.org; Sat, 20 Oct 2018 17:42:22 -0400 Original-Received: from world.peace.net ([64.112.178.59]:60306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDz0m-0006t1-Tq for 22034-done@debbugs.gnu.org; Sat, 20 Oct 2018 17:42:21 -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 1gDz0h-0007rS-67; Sat, 20 Oct 2018 17:42:15 -0400 In-Reply-To: <20151127195146.GB28472@fysh.org> (Zefram's message of "Fri, 27 Nov 2015 19:51:46 +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:9216 Archived-At: Zefram writes: > time-utc->date seems to think that a leap second occurs at a different > time in each time zone: > > scheme@(guile-user)> (use-modules (srfi srfi-19)) > scheme@(guile-user)> (define (tdate d) (write (list (date->string d "~4") (date->string (time-utc->date (date->time-utc d) 3600) "~4"))) (newline)) > scheme@(guile-user)> (tdate (make-date 0 59 59 22 30 6 2012 0)) > ("2012-06-30T22:59:59Z" "2012-06-30T23:59:59+0100") > scheme@(guile-user)> (tdate (make-date 0 0 0 23 30 6 2012 0)) > ("2012-06-30T23:00:00Z" "2012-06-30T23:59:60+0100") > scheme@(guile-user)> (tdate (make-date 0 1 0 23 30 6 2012 0)) > ("2012-06-30T23:00:01Z" "2012-07-01T00:00:01+0100") > > These are three consecutive seconds that occur an hour before a genuine > leap second (at 23:59:60Z). Observe that time-utc->date, applied to the > middle second, describes it as a leap second happening at 23:59:60+01:00, > which is bogus. [...] This is fixed by commit 5106377a3460e1e35daf14ea6edbe80426347155 on the stable-2.2 branch. > Matching up with this, the actual leap second is never correctly described > with a non-zero zone offset. It should be, for example, 00:59:60+01:00. If I understand correctly, 'time-utc->date' should never return a date object with 60 in the seconds field, because those extra seconds have no representation in time-utc. They only have representations in time-tai and time-monotonic. Anyway, thanks very much for these reports! I'm closing this bug now, but feel free to reopen if you think there are still issues to resolve. Mark