From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zefram Newsgroups: gmane.lisp.guile.bugs Subject: bug#21912: TAI<->UTC conversion botches the unknown Date: Fri, 13 Nov 2015 16:44:27 +0000 Message-ID: <20151113164427.GS13455@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1447433122 22437 80.91.229.3 (13 Nov 2015 16:45:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Nov 2015 16:45:22 +0000 (UTC) To: 21912@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Nov 13 17:45:09 2015 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZxHTH-0007Zw-MZ for guile-bugs@m.gmane.org; Fri, 13 Nov 2015 17:45:07 +0100 Original-Received: from localhost ([::1]:53966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxHTH-0006M7-DU for guile-bugs@m.gmane.org; Fri, 13 Nov 2015 11:45:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxHTD-0006Lv-PE for bug-guile@gnu.org; Fri, 13 Nov 2015 11:45:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxHTC-0005sf-Mp for bug-guile@gnu.org; Fri, 13 Nov 2015 11:45:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxHTC-0005sa-J4 for bug-guile@gnu.org; Fri, 13 Nov 2015 11:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZxHTC-0000eH-6V for bug-guile@gnu.org; Fri, 13 Nov 2015 11:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Zefram Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 13 Nov 2015 16:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21912 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14474330962464 (code B ref -1); Fri, 13 Nov 2015 16:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Nov 2015 16:44:56 +0000 Original-Received: from localhost ([127.0.0.1]:37377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxHT5-0000dg-Lf for submit@debbugs.gnu.org; Fri, 13 Nov 2015 11:44:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37965) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxHSl-0000dG-Qs for submit@debbugs.gnu.org; Fri, 13 Nov 2015 11:44:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxHSk-0005i6-BP for submit@debbugs.gnu.org; Fri, 13 Nov 2015 11:44:35 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxHSk-0005i2-8Z for submit@debbugs.gnu.org; Fri, 13 Nov 2015 11:44:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxHSj-0006IX-7U for bug-guile@gnu.org; Fri, 13 Nov 2015 11:44:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxHSi-0005hS-8S for bug-guile@gnu.org; Fri, 13 Nov 2015 11:44:33 -0500 Original-Received: from river6.fysh.org ([2001:41d0:d:20da::2]:40025 helo=river.fysh.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxHSi-0005h7-0V for bug-guile@gnu.org; Fri, 13 Nov 2015 11:44:32 -0500 Original-Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1ZxHSd-0005q8-M0; Fri, 13 Nov 2015 16:44:27 +0000 Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7903 Archived-At: Probing the existence of leap seconds on particular days, via srfi-19's TAI-to-UTC conversion. The methodology here is to take noon UT on the day of interest, convert to TAI, add 86400 seconds, then convert to UTC and display. The resulting time of day is 11:59:59 if there is a leap second that day, and 12:00:00 if there is not. scheme@(guile-user)> (use-modules (srfi srfi-19)) scheme@(guile-user)> (date->string (time-tai->date (add-duration (julian-day->time-tai 2455743) (make-time time-duration 0 86400)) 0) "~4") $1 = "2011-07-01T12:00:00Z" scheme@(guile-user)> (date->string (time-tai->date (add-duration (julian-day->time-tai 2456109) (make-time time-duration 0 86400)) 0) "~4") $2 = "2012-07-01T11:59:59Z" scheme@(guile-user)> (date->string (time-tai->date (add-duration (julian-day->time-tai 2457204) (make-time time-duration 0 86400)) 0) "~4") $3 = "2015-07-01T12:00:00Z" scheme@(guile-user)> (date->string (time-tai->date (add-duration (julian-day->time-tai 2457935) (make-time time-duration 0 86400)) 0) "~4") $4 = "2017-07-01T12:00:00Z" For 2011-06-30 it is correct that there was not a leap second, and for 2012-06-30 it is correct that there was. But for 2015-06-30 it says there was not a leap second, when in fact there was. For 2017-06-30 it says there will not be a leap second, when in fact it is not yet determined whether there will be. Really both of these errors come from the same cause. At the time this Guile 2.0.11 was released, the leap status of 2015-06-30 had not yet been determined. Both 2015 and 2017 fall within the future period beyond the scope of this Guile's static leap second knowledge. The bug is not that Guile doesn't know that there was a leap second in 2015. As the 2017 case illustrates, it's impossible for it to know all the leap second scheduling about which it can be asked. The bug is that Guile *thinks* it knows about all future leap seconds. It specifically thinks that there will be no leaps at all beyond the historically-scheduled ones that it knows about. Guile ought to be aware of how far its leap table extends, and signal an error when asked to perform a TAI<->UTC conversion that falls outside its scope. -zefram