From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 497931F731 for ; Fri, 9 Aug 2019 14:43:23 +0000 (UTC) Received: from localhost ([::1]:59828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw670-0005dR-6s for normalperson@yhbt.net; Fri, 09 Aug 2019 10:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41946) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw66w-0005dF-7v for bug-gnulib@gnu.org; Fri, 09 Aug 2019 10:43:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hw66v-0001GF-46 for bug-gnulib@gnu.org; Fri, 09 Aug 2019 10:43:18 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:34597) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hw66u-0001F9-Tw for bug-gnulib@gnu.org; Fri, 09 Aug 2019 10:43:17 -0400 Received: by mail-pl1-x634.google.com with SMTP id i2so45089925plt.1 for ; Fri, 09 Aug 2019 07:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=aW3N1wf6aEnhvIX99WL664x5bgljjAB0gmCJCQdtRiQ=; b=Ys+QatJv+czuD/NFOo2jzS5NOS0ag8kapKq0F+1lsFJGROmRSj/dUMhXU2EHfcIYVQ PrVYz4mLa1EUi6wa4kb8MvxCPXR2IqvNwQPzzbm7gSu5MJGXYHztcD6wQv6m63qWmpbb P9PQ7mzK3x4xPjMU81T4EaAgmkkfy04EaCw5CbJOVZE4CeIIZBxsssRcD1wIFfP9eLOe urfx7lOWBTvXa7NBcsrpbOaVAtdod3baJPVliV9yIrU28Rqz0YqXj3wS7bFSkCteqXXv 3RoqEXPU+C9T2lSMZ4pBCirgastqQcvQ+PRd+uyDXXwWLOikZ6vFihqqFLTYme6wPu6j HeNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aW3N1wf6aEnhvIX99WL664x5bgljjAB0gmCJCQdtRiQ=; b=g4wIGDtvsUNKVvJuu+tF7ERRGeVq+zJHfBA3+mHMDE1Y/LTBzo8sMQugw8nMqgtW/W Hnj5+2YxBmSuqzOxSCcjQuWsCLveRaJrX4Xu9/WLVS966J+DO5NVEQ2X5rCfmtgHXCqI 9gTsW0ZLtUUGO01CvVGZ7DNCBAtF9hnV3t1hSvFeWhcNpTMOLoBZPq0tJ/XBSuUZGA5k ztPW/auH+pUFsa30l0dfv86UM9OVACQ4aZlSVW9wR1pU1DsLzOk9xAKpgO7FZJsa6N4J 6YHhN9Y67QnsPGUlqbCBPaEfZdSzURzWoYoSjuyP+A2qwCVZNyuIC9syUBiiIFd7Fz1T CGUQ== X-Gm-Message-State: APjAAAWsfoyXV+JX/LJVyUh9FN853Iz+ZmdMjiK0ny+/ljVtLZoqODCR MPZfoJ1G7+gb2prATOkQa2E9I/cI X-Google-Smtp-Source: APXvYqzLwHwT+UdKYX+LvBWF7nnprVe7Od0RtRKa6jZraQ2qGdB190FtCbktQAhrv5Vygd44wREfJg== X-Received: by 2002:a17:902:ab96:: with SMTP id f22mr12931678plr.147.1565361794949; Fri, 09 Aug 2019 07:43:14 -0700 (PDT) Received: from tomato.moose.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id 135sm113379596pfb.137.2019.08.09.07.43.13 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 09 Aug 2019 07:43:13 -0700 (PDT) Subject: Re: parse-datetime.y - Military Timezones are inverted from the correct sense To: Neil Hoggarth , bug-gnulib@gnu.org References: From: Assaf Gordon Message-ID: Date: Fri, 9 Aug 2019 08:43:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::634 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hello, On 2019-08-09 5:31 a.m., Neil Hoggarth wrote: > I have observed incorrect handling of "Military" timezones when > exercising the --date=... option of the GNU coreutils "date" utility. > I believe the underlying problem is with initialization of > "military_table[]" in the parse-datetime.y file of gnulib. [...] > > Utilities using parse-datetime routines interpret correctly interpret > "Z" as UTC, but all the letters the wrong way around: zone "A" should > be one hour ahead of UTC (Paris, France when not observing DST for > example), but parse-datetime has it one hour behind: Thank you for the report. For reference, it seems this change happened 20 years less 20 days ago, in commit c6cb26ec2993800dda1b95c213fc4539acd4fa51 from August 29, 1999: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=c6cb26ec2 This change rewrote the "lib/getdate.y" file (the precursor to lib/parse-datetime.y) from the public domain version into a more GNU-like style. It contained the following changes: ----- -/* Military timezone table. */ -static TABLE const MilitaryTable[] = { - { "a", tZONE, HOUR ( 1) }, - { "b", tZONE, HOUR ( 2) }, - { "c", tZONE, HOUR ( 3) }, - { "d", tZONE, HOUR ( 4) }, - { "e", tZONE, HOUR ( 5) }, [....] +/* Military time zone table. */ +static table const military_table[] = { + { "A", tZONE, -HOUR ( 1) }, + { "B", tZONE, -HOUR ( 2) }, + { "C", tZONE, -HOUR ( 3) }, + { "D", tZONE, -HOUR ( 4) }, + { "E", tZONE, -HOUR ( 5) }, ----- Since it was in 1999, it predates all "coreutils" versions (they were separate sh-utils,text-utils,file-utils packages). On GNU's ftp server ( https://ftp.gnu.org/old-gnu/sh-utils/ ), the last available version of sh-utils (version 2.0) from August 15, 1999 had the positive (A=1) military time zones. There are mentions (on the website and in coreutils' NEWS file) of later version sh-tuils-2.0.15 which likely had negative (A=-1) military time zones. The first public version of the unified coreutils-5.0 from 2003 already used the negative values. -assaf