From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 02:22:58 2017 Received: (at submit) by debbugs.gnu.org; 28 Jan 2017 07:22:58 +0000 Received: from localhost ([127.0.0.1]:48751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXNLe-0002gg-65 for submit@debbugs.gnu.org; Sat, 28 Jan 2017 02:22:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXMJM-00015Z-7v for submit@debbugs.gnu.org; Sat, 28 Jan 2017 01:16:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXMJG-0007vZ-6D for submit@debbugs.gnu.org; Sat, 28 Jan 2017 01:16:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_50,FORGED_YAHOO_RCVD, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cXMJG-0007vU-3C for submit@debbugs.gnu.org; Sat, 28 Jan 2017 01:16:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXMJF-0000TK-5E for bug-coreutils@gnu.org; Sat, 28 Jan 2017 01:16:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXMJC-0007uv-01 for bug-coreutils@gnu.org; Sat, 28 Jan 2017 01:16:25 -0500 Received: from nm18-vm3.bullet.mail.gq1.yahoo.com ([98.136.217.218]:46436) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1cXMJB-0007ul-NS for bug-coreutils@gnu.org; Sat, 28 Jan 2017 01:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1485584179; bh=UvC3KR7S/DP8Eje+i1bo/H4zmJnLDYvpA1cPRDkXTJY=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=hR41aTlVg2DcvLEUMHERNENV7eqH7PHZPaWzgMnhQzUfQZfuE7Txq8VdLnj0SKAOsFpGhj869odLRtJjYpDo97bnkOQHR0OcX+P99y+xFCvp55OtNHgXy4oQB3/HNHXjoGzLolIl7y12amxy7CQi9UaZHR3YDu55rW0UVSONYy6ohZlX708pWB/UkjZnfuynXUoTHats77bqg6u4TQKpWVbHwo6+TFuvmftAzGCUtZMZoO1rimEalsGXuuW97Q6Vki4w3lkeHVKNNy/47drjMkkh5eGB5XUXHFrQ0dPb/uNOXGZkkawGLyV5LvmCG9vk2cu3f45YwMceVrgsnshQVQ== Received: from [216.39.60.181] by nm18.bullet.mail.gq1.yahoo.com with NNFMP; 28 Jan 2017 06:16:19 -0000 Received: from [98.137.12.219] by tm17.bullet.mail.gq1.yahoo.com with NNFMP; 28 Jan 2017 06:16:19 -0000 Received: from [127.0.0.1] by omp1027.mail.gq1.yahoo.com with NNFMP; 28 Jan 2017 06:16:19 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 589804.57847.bm@omp1027.mail.gq1.yahoo.com X-YMail-OSG: wlMB6mEVM1k2k.9LTdvxm2.UYNkPEK_YrajQwolt8TqfOGLKIv2zYIY9LdIKrNz WEQPJ1CuhKwZfkOhGd31F4T17sa0x0CfQX8OEkqbVwzoKCgRuY0s7HZrD5UHEiczEg8I5MGTa6uO 2PJW3nccTornUwPsmQhvfvMn2QptQrHQEb01pVYZixsX4xZjCw0qHmB_vjHZNMu0W_vidDN4pzRM iJhIDFJeDDEpjSC0Ojluxj2jQX1XuyxnCmmup3lcXOqblgOxcExtWAAR5ZWy1p3rupX76FePsVM2 tieT8Mpt8gxQXDfPbWWzqpF.5xWMDdKoCD3mFLzqoaG5G_OZCYPuR_iICoWES3JAiNZf6euvZ.mV OTq5ly4RA9OyL7wmbcNoqzRftBqGhTwU5FhiLM0dZHqjpB6rQmpQ0kc3.yc_9ZUFCWV074r8f8MS OZZPE.vbN7fZ.xscbd30XXIzj_137cP8MGSPb7A9ArrMAf5SDq2iCvpkBJK2ZaSnZp5l4do9QnZB fiEYH9qt0V2YrcR_9sYd0P55jXq6gKKuaEXyMjx2ctioBmOhSZnHzZ.cLZRlWbg-- Received: from jws300038.mail.gq1.yahoo.com by sendmailws122.mail.gq1.yahoo.com; Sat, 28 Jan 2017 06:16:19 +0000; 1485584179.227 Date: Sat, 28 Jan 2017 06:15:58 +0000 (UTC) From: Owen Leibman To: "bug-coreutils@gnu.org" Message-ID: <2020233370.3114162.1485584158847@mail.yahoo.com> Subject: Alphabetic Character Following date -d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> Content-Length: 1709 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 28 Jan 2017 02:22:57 -0500 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: , Reply-To: Owen Leibman Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Testing a script to see how it handled invalid data, I had it execute the c= ommand: date -d "x023-04-05 01:00" Somewhat surprisingly, this was not treated as an error. The response was: Tue Apr 4 06:07:02 LMT 0023 This happened on a Ubuntu system using coreutils-8.25. However, I was not able to duplicate it on a Cygwin system using coreutils = 8.26, Where the date was flagged as invalid. So, at a guess, this was a bug that was fixed in 8.26. But, not so fast - the following commands give identical surprising results= with both versions (for convenience, I set my time zone to UTC before issuing these commands): date -d a Sat, Jan 28, 2017 1:00:00 AM I searched the man and info pages in vain for how the command might be inte= rpreting "a" here. If there is some place where this is documented and I just missed it, pleas= e let me know. In the meantime, I'll continue. I tried other letters - "b" through "i" each advanced the displayed time by= 1 hour (so "i" was 9:00). Upper- and lower-case were treated the same. At "j", I had a surprise: date -d j date: invalid date =E2=80=98j=E2=80=99 But then I was equally surprised by "k": date -d k Sat, Jan 28, 2017 10:00:00 AM It seems to have picked up where the sequence was broken. Continuing, "l" advanced to 11:00, and "m" to 12:00 (PM - presumably noon). Another surprise came with "n": date -d n Fri, Jan 27, 2017 11:00:00 PM >From that point, the result marches backwards by an hour each time until "x= " reaches 1:00 p.m. Then "y" matches the output for "m". And "z": date -d z Sat, Jan 28, 2017 12:00:00 AM And, having run out of letters, my test was complete. Is the date command behaving as it should for all these examples? From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 05:36:09 2017 Received: (at 25560-done) by debbugs.gnu.org; 28 Jan 2017 10:36:09 +0000 Received: from localhost ([127.0.0.1]:48788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXQMa-00073D-Vx for submit@debbugs.gnu.org; Sat, 28 Jan 2017 05:36:09 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXQMa-00072z-0D for 25560-done@debbugs.gnu.org; Sat, 28 Jan 2017 05:36:08 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1C7621600EE; Sat, 28 Jan 2017 02:36:01 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FOoE0uViXY-w; Sat, 28 Jan 2017 02:36:00 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 471FF1600EF; Sat, 28 Jan 2017 02:36:00 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7jLFtNL-wSDL; Sat, 28 Jan 2017 02:35:59 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B0DE61600EE; Sat, 28 Jan 2017 02:35:59 -0800 (PST) Subject: Re: bug#25560: Alphabetic Character Following date -d To: Owen Leibman , 25560-done@debbugs.gnu.org References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <4712b2cb-309c-bb0b-2d69-d73c758a2f0a@cs.ucla.edu> Date: Sat, 28 Jan 2017 02:35:59 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <2020233370.3114162.1485584158847@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25560-done 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: -3.2 (---) Owen Leibman wrote: > Is the date command behaving as it should for all these examples? Those letters are military time zone abbreviations, so yes. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 08:31:53 2017 Received: (at 25560) by debbugs.gnu.org; 28 Jan 2017 13:31:53 +0000 Received: from localhost ([127.0.0.1]:48843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXT6f-0004QL-9H for submit@debbugs.gnu.org; Sat, 28 Jan 2017 08:31:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXT6c-0004Q7-LM for 25560@debbugs.gnu.org; Sat, 28 Jan 2017 08:31:51 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99ACB61B9B; Sat, 28 Jan 2017 13:31:45 +0000 (UTC) Received: from [10.10.117.56] (ovpn-117-56.rdu2.redhat.com [10.10.117.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14152306BF; Sat, 28 Jan 2017 13:31:44 +0000 (UTC) Subject: Re: bug#25560: Alphabetic Character Following date -d To: Owen Leibman , 25560@debbugs.gnu.org References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56bd7e97-d54e-6dfd-2e06-d754c550d240@redhat.com> Date: Sat, 28 Jan 2017 07:31:43 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <2020233370.3114162.1485584158847@mail.yahoo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hwUP0T3cITiKrL5xbCepcI0Ep6E9ITgSh" X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 28 Jan 2017 13:31:45 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25560 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hwUP0T3cITiKrL5xbCepcI0Ep6E9ITgSh Content-Type: multipart/mixed; boundary="8QNjkQWDm2tfM9JsjCfHKdNu9QbNkcXlp"; protected-headers="v1" From: Eric Blake To: Owen Leibman , 25560@debbugs.gnu.org Message-ID: <56bd7e97-d54e-6dfd-2e06-d754c550d240@redhat.com> Subject: Re: bug#25560: Alphabetic Character Following date -d References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> In-Reply-To: <2020233370.3114162.1485584158847@mail.yahoo.com> --8QNjkQWDm2tfM9JsjCfHKdNu9QbNkcXlp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/28/2017 12:15 AM, Owen Leibman wrote: > Testing a script to see how it handled invalid data, I had it execute t= he command: > date -d "x023-04-05 01:00" > Somewhat surprisingly, this was not treated as an error. The response w= as: > Tue Apr 4 06:07:02 LMT 0023 >=20 > This happened on a Ubuntu system using coreutils-8.25. > However, I was not able to duplicate it on a Cygwin system using coreut= ils 8.26, > Where the date was flagged as invalid. > So, at a guess, this was a bug that was fixed in 8.26. Odd, because running the latest coreutils.git on 64-bit Linux, I see: $ src/date --debug -d "x023-04-05 01:00" date: parsed zone part: TZ=3D+11:00 date: parsed date part: (Y-M-D) 0023-04-05 date: parsed time part: 01:00:00 date: input timezone: +11:00 (set from parsed date/time string) date: using specified time as starting value: '01:00:00' date: starting date/time: '(Y-M-D) 0023-04-05 01:00:00 TZ=3D+11:00' date: '(Y-M-D) 0023-04-05 01:00:00 TZ=3D+11:00' =3D -61433287200 epoch-se= conds date: output timezone: -06:00 (set from system default) date: final: -61433287200.000000000 (epoch-seconds) date: final: (Y-M-D) 0023-04-04 14:00:00 (UTC0) date: final: (Y-M-D) 0023-04-04 08:09:24 (output timezone TZ=3D-06:00) Tue Apr 4 08:09:24 LMT 0023 vs. this in a VM on 32-bit Cygwin with date 8.26: $ date --debug -d "x023-04-05 01:00" date: parsed zone part: TZ=3D+11:00 date: parsed date part: (Y-M-D) 0023-04-05 date: parsed time part: 01:00:00 date: input timezone: +11:00 (set from parsed date/time string) date: using specified time as starting value: '01:00:00' date: error: invalid date/time value: date: user provided time: '(Y-M-D) 0023-04-05 01:00:00 TZ=3D+11:00' date: normalized time: '(Y-M-D) 0023-04-05 01:00:00 TZ=3D+11:00' date: date: possible reasons: date: numeric values overflow; date: incorrect timezone date: invalid date 'x023-04-05 01:00' Okay, so maybe the problem is because it's a 32-bit environment. Firing up my 64-bit VM, and Cygwin now gives: Tue, Apr 4, 0023 8:09:24 AM Aha - that explains it! 32-bit time_t on 32-bit Cygwin overflows, while 64-bit time_t did not. >=20 > But, not so fast - the following commands give identical surprising res= ults with both versions > (for convenience, I set my time zone to UTC before issuing these comman= ds): The new 'date --debug' option in coreutils 8.26 is amazing; it explains all of these questions you have. > Is the date command behaving as it should for all these examples? Yes. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8QNjkQWDm2tfM9JsjCfHKdNu9QbNkcXlp-- --hwUP0T3cITiKrL5xbCepcI0Ep6E9ITgSh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYjJ0/AAoJEKeha0olJ0NqZM0H/A9O+eaEqNjfiaJYrw/97XOu aVD67OM26vd3B+dbsiCV2s3OkLnGDqdt5ttgnhMm05C9CSU5mi7vOyfGNPLpLr+e a100hS+TBec1Ag4NALB4CWrPnrU5tQnPA8YD5DP78/t/0nIFiy9xeUE2jcZTudL3 enjqBerHq17/KiN3yvk3Qo3Ad8CZShKll9IRXeJPnYFk2HXptf3/3i8nQRdgMD+o P5OzHIck3eQran7o0oEeL1Q8hrJb1yXl3Q/DQpqtXXrHHdBLcRRSIfB3Z4A5akgs 8oKlWvyHhhehWt27IifIgPej7jU1JG8W2pmwuAeHUYI3rxh7wnw8PzN/OLBVoLM= =dlAH -----END PGP SIGNATURE----- --hwUP0T3cITiKrL5xbCepcI0Ep6E9ITgSh-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 08:32:19 2017 Received: (at control) by debbugs.gnu.org; 28 Jan 2017 13:32:19 +0000 Received: from localhost ([127.0.0.1]:48847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXT75-0004RM-JO for submit@debbugs.gnu.org; Sat, 28 Jan 2017 08:32:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXT74-0004RA-Dl for control@debbugs.gnu.org; Sat, 28 Jan 2017 08:32:18 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CBA93D96E for ; Sat, 28 Jan 2017 13:32:14 +0000 (UTC) Received: from [10.10.117.56] (ovpn-117-56.rdu2.redhat.com [10.10.117.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B948306BF for ; Sat, 28 Jan 2017 13:32:13 +0000 (UTC) Subject: Re: bug#25560: Alphabetic Character Following date -d To: GNU bug control References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <4f820b63-4e68-f16a-5557-438221e1f437@redhat.com> Date: Sat, 28 Jan 2017 07:32:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <2020233370.3114162.1485584158847@mail.yahoo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3PXLODJEVMQs4KSTlFciES3hInxLI2qst" X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 28 Jan 2017 13:32:14 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: control 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3PXLODJEVMQs4KSTlFciES3hInxLI2qst Content-Type: multipart/mixed; boundary="ap8w3fU6kcDcnCLMpUa3lmRqhbTgpcPwv"; protected-headers="v1" From: Eric Blake To: GNU bug control Message-ID: <4f820b63-4e68-f16a-5557-438221e1f437@redhat.com> Subject: Re: bug#25560: Alphabetic Character Following date -d References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> In-Reply-To: <2020233370.3114162.1485584158847@mail.yahoo.com> --ap8w3fU6kcDcnCLMpUa3lmRqhbTgpcPwv Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 25560 notabug close 25560 thanks On 01/28/2017 12:15 AM, Owen Leibman wrote: > Testing a script to see how it handled invalid data, I had it execute t= he command: > date -d "x023-04-05 01:00" > Somewhat surprisingly, this was not treated as an error. The response w= as: > Tue Apr 4 06:07:02 LMT 0023 >=20 > This happened on a Ubuntu system using coreutils-8.25. > However, I was not able to duplicate it on a Cygwin system using coreut= ils 8.26, > Where the date was flagged as invalid. > So, at a guess, this was a bug that was fixed in 8.26. >=20 > But, not so fast - the following commands give identical surprising res= ults with both versions > (for convenience, I set my time zone to UTC before issuing these comman= ds): >=20 > date -d a > Sat, Jan 28, 2017 1:00:00 AM >=20 > I searched the man and info pages in vain for how the command might be = interpreting "a" here. > If there is some place where this is documented and I just missed it, p= lease let me know. > In the meantime, I'll continue. >=20 > I tried other letters - "b" through "i" each advanced the displayed tim= e by 1 hour (so "i" was 9:00). > Upper- and lower-case were treated the same. >=20 > At "j", I had a surprise: >=20 > date -d j > date: invalid date =E2=80=98j=E2=80=99 >=20 > But then I was equally surprised by "k": >=20 > date -d k > Sat, Jan 28, 2017 10:00:00 AM >=20 > It seems to have picked up where the sequence was broken. > Continuing, "l" advanced to 11:00, and "m" to 12:00 (PM - presumably no= on). > Another surprise came with "n": >=20 > date -d n > Fri, Jan 27, 2017 11:00:00 PM >=20 >>>From that point, the result marches backwards by an hour each time unti= l "x" reaches 1:00 p.m. > Then "y" matches the output for "m". And "z": >=20 > date -d z > Sat, Jan 28, 2017 12:00:00 AM >=20 > And, having run out of letters, my test was complete. >=20 > Is the date command behaving as it should for all these examples? >=20 >=20 >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ap8w3fU6kcDcnCLMpUa3lmRqhbTgpcPwv-- --3PXLODJEVMQs4KSTlFciES3hInxLI2qst Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYjJ1bAAoJEKeha0olJ0Nqg3EH/ixBHIPWm9zR9jm7PdHqb8dJ qa7wKpB1QXNSRsHET7FMeZXI40LzJkRqckpNzJcj98QSRiw2r0R0Cx0DBSiQcErl XGsZRzdwFGVQW63OgV2drmqHp5+k1TGcwigT2s/m9yvOJ1/3b2VgL2YLv1L01aKg mVi3il/+EUytkD9EM4XGc9ttTGOCWIppjs0jEbAUsWCP18Bvv1IkbJx8c5Xa6oBY DnmwabXMYNYbmmsOX9ZwX3lHq/MsiOswNrXwQfX17+d5p3mVVOQZTCvYtUuUhUEs 8bneFqBvkBYIZBD69bfE8F0uYPq1Wl8R84D3wu3fm7ZxS8y5eo38iCmmES0i8P4= =8LRy -----END PGP SIGNATURE----- --3PXLODJEVMQs4KSTlFciES3hInxLI2qst-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 20:53:57 2017 Received: (at 25560) by debbugs.gnu.org; 30 Jan 2017 01:53:57 +0000 Received: from localhost ([127.0.0.1]:50596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cY1AK-0000d6-Mz for submit@debbugs.gnu.org; Sun, 29 Jan 2017 20:53:57 -0500 Received: from nm12-vm5.bullet.mail.gq1.yahoo.com ([98.136.218.204]:57311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cY0qo-0000B8-6l for 25560@debbugs.gnu.org; Sun, 29 Jan 2017 20:33:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1485740020; bh=8qmyszcRnJfgVCUPr0nnFez9BklHZEF3ADduGTkrhBw=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=PL9AMrnLZQ3ufQ/gnq7t2U5PEtrrX0GyokRnUyZ5ySDCznwtMtS2D30sUMU/RE1DS+KR33rMSO+1uber2shZp0ic6gkYT+lyxnlWSBD15dVeS070x6Gy0MCPWow5C61rJgMrWdBgaiPCC5PxpyCxAwN+eNBOtQj2zZhZwBNnfuqFqJfPgyFv0Wo2ROzr9Fy9+0Pch9+am40vsHPJvhGO9ih4W2zcnk7BEBcg3pv85wGVbGUFZOq4Ip0JBgQ0+DqGPNw/plLRK3fL+zTa4lfIiWljfOsPuFxQZNLUoRuQdke0z4mqsS+1VQJPlqRqlTb8pLTce0eH539ehSIXYoeHhA== Received: from [98.137.12.188] by nm12.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jan 2017 01:33:40 -0000 Received: from [98.137.12.241] by tm9.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jan 2017 01:33:40 -0000 Received: from [127.0.0.1] by omp1049.mail.gq1.yahoo.com with NNFMP; 30 Jan 2017 01:33:40 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 474603.97839.bm@omp1049.mail.gq1.yahoo.com X-YMail-OSG: 9okxjAgVM1kafkqPWe_vQc2TbVBy8EdFCu6332kfvBvcB0izVEs94kpZeZpNLyf mP1U4BgxXCUyT8LQuhuemPShTukGvNzHjUmps1ZAR98C1UzkxKZyzQ5FktmdOCqF.b5tNBZLftQ7 jeJ7x0pR6B0_D9MXM6zX1Wwgq0iXf51gNXaLq8bv6M.RYt6PpCjMx6btUUp5iLj.yXDiDtxb5F9q 7ZM2yiyCSFvf.pLumOo5rha_HQl4AbQZi7Bl_V0t.fMzTsgG0RkvucVTuSSW_GDUYm0C33VsBHps V7gwB0s_Jluc5rCFnHTfxSrlwc5kF48.vmxZGZW7vO22gnAkH7sKOvbw63yDBa7wlP.CVoLLG0qT I03dCi0X0ePmsrsCFoqaia2Ppa4I22nWbZw3xZ8IbzfhpZxZZMbKt1bJWsGSubqbT6_N.qxTbeuj wucxDxCZLRVnzKHMFXzpG9b6ZQOo3mn7DPRoaXynS29r9uvjfg1_7xFbNjFVzO3biDhblhzSi_K8 SiB3ohk9zVTcJRUb2Z3vHA_Ob.BQdwWNDjkO01yEN4vPmYDAoipN1JBmmt0AGvcXw Received: from jws300067.mail.gq1.yahoo.com by sendmailws108.mail.gq1.yahoo.com; Mon, 30 Jan 2017 01:33:40 +0000; 1485740020.055 Date: Mon, 30 Jan 2017 01:33:39 +0000 (UTC) From: Owen Leibman To: Eric Blake , "25560@debbugs.gnu.org" <25560@debbugs.gnu.org> Message-ID: <1109658114.4037879.1485740019614@mail.yahoo.com> In-Reply-To: <56bd7e97-d54e-6dfd-2e06-d754c550d240@redhat.com> References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> <56bd7e97-d54e-6dfd-2e06-d754c550d240@redhat.com> Subject: Re: bug#25560: Alphabetic Character Following date -d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 2955 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: 25560 X-Mailman-Approved-At: Sun, 29 Jan 2017 20:53:55 -0500 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: , Reply-To: Owen Leibman Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) Thank you so much for the tip about --debug (agree with your assessment), and for doing the further research in Cygwin. ----- Original Message ----- From: Eric Blake To: Owen Leibman ; 25560@debbugs.gnu.org Sent: Saturday, January 28, 2017 5:31 AM Subject: Re: bug#25560: Alphabetic Character Following date -d On 01/28/2017 12:15 AM, Owen Leibman wrote: > Testing a script to see how it handled invalid data, I had it execute the command: > date -d "x023-04-05 01:00" > Somewhat surprisingly, this was not treated as an error. The response was: > Tue Apr 4 06:07:02 LMT 0023 > > This happened on a Ubuntu system using coreutils-8.25. > However, I was not able to duplicate it on a Cygwin system using coreutils 8.26, > Where the date was flagged as invalid. > So, at a guess, this was a bug that was fixed in 8.26. Odd, because running the latest coreutils.git on 64-bit Linux, I see: $ src/date --debug -d "x023-04-05 01:00" date: parsed zone part: TZ=+11:00 date: parsed date part: (Y-M-D) 0023-04-05 date: parsed time part: 01:00:00 date: input timezone: +11:00 (set from parsed date/time string) date: using specified time as starting value: '01:00:00' date: starting date/time: '(Y-M-D) 0023-04-05 01:00:00 TZ=+11:00' date: '(Y-M-D) 0023-04-05 01:00:00 TZ=+11:00' = -61433287200 epoch-seconds date: output timezone: -06:00 (set from system default) date: final: -61433287200.000000000 (epoch-seconds) date: final: (Y-M-D) 0023-04-04 14:00:00 (UTC0) date: final: (Y-M-D) 0023-04-04 08:09:24 (output timezone TZ=-06:00) Tue Apr 4 08:09:24 LMT 0023 vs. this in a VM on 32-bit Cygwin with date 8.26: $ date --debug -d "x023-04-05 01:00" date: parsed zone part: TZ=+11:00 date: parsed date part: (Y-M-D) 0023-04-05 date: parsed time part: 01:00:00 date: input timezone: +11:00 (set from parsed date/time string) date: using specified time as starting value: '01:00:00' date: error: invalid date/time value: date: user provided time: '(Y-M-D) 0023-04-05 01:00:00 TZ=+11:00' date: normalized time: '(Y-M-D) 0023-04-05 01:00:00 TZ=+11:00' date: date: possible reasons: date: numeric values overflow; date: incorrect timezone date: invalid date 'x023-04-05 01:00' Okay, so maybe the problem is because it's a 32-bit environment. Firing up my 64-bit VM, and Cygwin now gives: Tue, Apr 4, 0023 8:09:24 AM Aha - that explains it! 32-bit time_t on 32-bit Cygwin overflows, while 64-bit time_t did not. > > But, not so fast - the following commands give identical surprising results with both versions > (for convenience, I set my time zone to UTC before issuing these commands): The new 'date --debug' option in coreutils 8.26 is amazing; it explains all of these questions you have. > Is the date command behaving as it should for all these examples? Yes. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 20:53:56 2017 Received: (at 25560-done) by debbugs.gnu.org; 30 Jan 2017 01:53:56 +0000 Received: from localhost ([127.0.0.1]:50594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cY1AK-0000d3-8p for submit@debbugs.gnu.org; Sun, 29 Jan 2017 20:53:56 -0500 Received: from nm12-vm6.bullet.mail.gq1.yahoo.com ([98.136.218.205]:51767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cY0pG-00008o-Tg for 25560-done@debbugs.gnu.org; Sun, 29 Jan 2017 20:32:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1485739923; bh=WLNOvmS1r/0iqnPrshhg1UfyWNceM3Fku1Pg0VrS2P8=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=rFY8lrPyYIgSl+W1nJK3HNJz+Bu3nPzKtZuwonaJJwYtwvOurfMbU2m9Y7PolUVcfcQqZ/0SQjbREJ8Z9fN2P4Wg4/HceA4O8T/S3I4JSxu9qq5Y+h4OHE+goGFiL5/+LOUJy0ybR6YGEBRDFZ2wqlAP/OvgMqJjVNv9l0Glj4GzX/1SRYe/YmtBgghgz0USSQot50elxf5OvOYLpYphmmT+BC9cHZZgdbqlw2gRPMqHPGY09aZWLFLIfwjZC3DqUP3egLHv8ekkVV2FxT6RFQC9RZBXzSqxOe0AhS0TVnTCnAzIaqFMSaNOAyiePi3y1n1rt3hNNFXIDllw0c351Q== Received: from [98.137.12.188] by nm12.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jan 2017 01:32:03 -0000 Received: from [98.137.12.201] by tm9.bullet.mail.gq1.yahoo.com with NNFMP; 30 Jan 2017 01:32:03 -0000 Received: from [127.0.0.1] by omp1009.mail.gq1.yahoo.com with NNFMP; 30 Jan 2017 01:32:03 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 591384.79404.bm@omp1009.mail.gq1.yahoo.com X-YMail-OSG: uVTVPewVM1mnEg.nMTMGmVJoPn4KGCW44GLc07xDdzE8iF4ZBPHLr_MZJQH97EW HMxERJQsR6RVCeQrC6o2hLoAgvjAb53D4nTP5yW8qznF1duO5QY1nI0lKh9IG3mscyo_vO5ZTti1 1HTwW681EFG4_pdxvcDrJa1IHIHCGzhIAZVC908iVqKV7cPPde61PErLFN.YO09RJ_YfCWf8LKXy wbBijzlKCyKFKe7Y3MIklYF45VhMBVouv4DNuHSfTdED8TMLYBIzaXfpUb_oXEhEZRsztP8MFwR. DVKa2xhEcsT9ZI0OFkQ7SYzebjn5QNJpk7rtmEIkkTkRWwZvnYtIUkPXFS_GkdLxLX2bzMFClm4t QvmohMrx4vRHoIshgR8Jxh.Wq4W8Ya.K68LE9efnNKHCjjzDwXzwS0vnZlzffKeXaXwPIhmuBQg3 bJxJNoYErUqPsFhvWj8fImFR78DPCAafh_4pH9iZ5nf7zWtc68bzFCWyUJub7FkfVQL_DCtfo65m 2YLbYs41dhI1IUIK22DIYkvRc83Vy8GcD4qxavhTb7GS7jJvgjXqk4doa.RLod6S6CpmmCDjgltG UY5qe1RPPydeiKdPpCQ-- Received: from jws300082.mail.gq1.yahoo.com by sendmailws126.mail.gq1.yahoo.com; Mon, 30 Jan 2017 01:32:03 +0000; 1485739923.179 Date: Mon, 30 Jan 2017 01:30:09 +0000 (UTC) From: Owen Leibman To: Paul Eggert , "25560-done@debbugs.gnu.org" <25560-done@debbugs.gnu.org> Message-ID: <420852283.4038422.1485739809604@mail.yahoo.com> In-Reply-To: <4712b2cb-309c-bb0b-2d69-d73c758a2f0a@cs.ucla.edu> References: <2020233370.3114162.1485584158847.ref@mail.yahoo.com> <2020233370.3114162.1485584158847@mail.yahoo.com> <4712b2cb-309c-bb0b-2d69-d73c758a2f0a@cs.ucla.edu> Subject: Re: bug#25560: Alphabetic Character Following date -d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 465 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: 25560-done X-Mailman-Approved-At: Sun, 29 Jan 2017 20:53:55 -0500 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: , Reply-To: Owen Leibman Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) What an interesting answer (and the follow-up research)! Thanks. ----- Original Message ----- From: Paul Eggert To: Owen Leibman ; 25560-done@debbugs.gnu.org Sent: Saturday, January 28, 2017 2:35 AM Subject: Re: bug#25560: Alphabetic Character Following date -d Owen Leibman wrote: > Is the date command behaving as it should for all these examples? Those letters are military time zone abbreviations, so yes. From unknown Fri Jun 20 18:15:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 27 Feb 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator