From unknown Sat Jun 14 03:54:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26632: TAI<->UTC conversion botches 1961 to 1971 Resent-From: Zefram Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Apr 2017 01:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26632 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 26632@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149299577724497 (code B ref -1); Mon, 24 Apr 2017 01:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Apr 2017 01:02:57 +0000 Received: from localhost ([127.0.0.1]:36958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2SOy-0006Ms-UD for submit@debbugs.gnu.org; Sun, 23 Apr 2017 21:02:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2SOt-0006ML-7p for submit@debbugs.gnu.org; Sun, 23 Apr 2017 21:02:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2SOj-0008G2-MV for submit@debbugs.gnu.org; Sun, 23 Apr 2017 21:02:42 -0400 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,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2SOj-0008Fy-Jq for submit@debbugs.gnu.org; Sun, 23 Apr 2017 21:02:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2SOe-00055H-RC for bug-guile@gnu.org; Sun, 23 Apr 2017 21:02:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2SOa-0008EF-DA for bug-guile@gnu.org; Sun, 23 Apr 2017 21:02:32 -0400 Received: from river6.fysh.org ([2001:41d0:d:20da::2]:34710 helo=river.fysh.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2SOa-0008D7-39 for bug-guile@gnu.org; Sun, 23 Apr 2017 21:02:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fysh.org; s=20170316; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=4CURIA3HFcx9WEuF2Q1PJofcTClP5tZfecA7g2TwMnI=; b=XeW7voiWcVv7giQtDxh38gnYK1Ay9yqTKENDv+0zO/IX1bY2f5h10DOFP2CKSKJiXDJwl51BflIW8iiY9EwqpYhq0gYat3KbGm0AH0iDbvuMFC1OyXlig848vK6zIZBw2VG6RimMMAWakLfoxgcsHJDL7WaDroNVx3YIaOVVVMs=; Received: from zefram by river.fysh.org with local (Exim 4.84_2 #1 (Debian)) id 1d2SOQ-0006e3-K2; Mon, 24 Apr 2017 02:02:18 +0100 Date: Mon, 24 Apr 2017 02:02:18 +0100 From: Zefram Message-ID: <20170424010218.GL6765@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.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: -4.0 (----) The SRFI-19 library gets TAI<->UTC conversions badly wrong in the years 1961 to 1971 (inclusive). This has to be examined somewhat indirectly, because SRFI-19 doesn't offer any way to display a TAI time in its conventional form as a date-like structure, nor to input a TAI time from such a structure. SRFI-19's date structure, as implemented, is always interpreted according to UTC. The only operations supported on TAI time structures are conversions to and from the various forms of UTC, conversions to and from the less-useful `monotonic' time, and arithmetic operations. Thus the erroneous TAI<->UTC conversions only come out through arithmetic operations in TAI space. One must also be careful to avoid unrelated bugs such as bug#21911. First I'll consider an ordinary day in 1967: scheme@(guile-user)> (use-modules (srfi srfi-19)) scheme@(guile-user)> (time-difference ... (time-utc->time-tai (date->time-utc (make-date 0 0 0 0 15 3 1967 0))) ... (time-utc->time-tai (date->time-utc (make-date 0 0 0 0 14 3 1967 0)))) $1 = #