From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 29 22:05:06 2013 Received: (at submit) by debbugs.gnu.org; 30 Oct 2013 02:05:06 +0000 Received: from localhost ([127.0.0.1]:51762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VbL9e-0004YZ-5P for submit@debbugs.gnu.org; Tue, 29 Oct 2013 22:05:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57551) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VbL3S-0004Mq-3v for submit@debbugs.gnu.org; Tue, 29 Oct 2013 21:58:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbL3D-0006C2-AN for submit@debbugs.gnu.org; Tue, 29 Oct 2013 21:58:36 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbL3D-0006Bu-8L for submit@debbugs.gnu.org; Tue, 29 Oct 2013 21:58:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbL35-0004wx-V6 for bug-coreutils@gnu.org; Tue, 29 Oct 2013 21:58:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbL2x-00069E-FO for bug-coreutils@gnu.org; Tue, 29 Oct 2013 21:58:19 -0400 Received: from ct11.fastbighost.net ([195.191.24.151]:56380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbL2x-000696-89 for bug-coreutils@gnu.org; Tue, 29 Oct 2013 21:58:11 -0400 Received: from c-69-248-34-185.hsd1.nj.comcast.net ([69.248.34.185]:38664 helo=[192.168.1.62]) by ct11.fastbighost.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1VbL2o-0006ON-TE; Wed, 30 Oct 2013 01:58:03 +0000 Message-ID: <527067AD.2070008@andy-lamb.com> Date: Tue, 29 Oct 2013 21:58:05 -0400 From: Andy Lamb User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Date problem Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ct11.fastbighost.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - andy-lamb.com X-Get-Message-Sender-Via: ct11.fastbighost.net: authenticated_id: andy@andy-lamb.com X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 29 Oct 2013 22:05:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) Hello, February of 2013 does not work, it comes up with March twice! /bin/date --date=-6 month +%b%Y = Apr2013 /bin/date --date=-7 month +%b%Y = Mar2013 /bin/date --date=-8 month +%b%Y = Mar2013 /bin/date --date=-9 month +%b%Y = Jan2013 Neither of these work: file /bin/date /bin/date: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped file /bin/date /bin/date: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped Thanks, Andy From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 29 23:02:17 2013 Received: (at control) by debbugs.gnu.org; 30 Oct 2013 03:02:17 +0000 Received: from localhost ([127.0.0.1]:51852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VbM2y-00061o-JM for submit@debbugs.gnu.org; Tue, 29 Oct 2013 23:02:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64418) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VbM2u-00061W-OM; Tue, 29 Oct 2013 23:02:14 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9U326tj020365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Oct 2013 23:02:06 -0400 Received: from [10.3.113.57] (ovpn-113-57.phx2.redhat.com [10.3.113.57]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9U325Ol026727; Tue, 29 Oct 2013 23:02:06 -0400 Message-ID: <527076AD.8010805@redhat.com> Date: Tue, 29 Oct 2013 21:02:05 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Andy Lamb , 15752-done@debbugs.gnu.org Subject: Re: bug#15752: Date problem References: <527067AD.2070008@andy-lamb.com> In-Reply-To: <527067AD.2070008@andy-lamb.com> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xWNWjSnKtqRKKtJ9m8m5X5b4ohwC8qAdm" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xWNWjSnKtqRKKtJ9m8m5X5b4ohwC8qAdm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 15752 notabug thanks On 10/29/2013 07:58 PM, Andy Lamb wrote: > Hello, >=20 > February of 2013 does not work, it comes up with March twice! >=20 > /bin/date --date=3D-6 month +%b%Y =3D Apr2013 > /bin/date --date=3D-7 month +%b%Y =3D Mar2013 > /bin/date --date=3D-8 month +%b%Y =3D Mar2013 > /bin/date --date=3D-9 month +%b%Y =3D Jan2013 This is a FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-co= mmand-is-not-working-right_002e Subtracting by months is fuzzy (does it mean multiples of 28, 29, 30, or 31 days? What is one month after Oct 31, Nov 30 or Dec 1?). Daylight Savings doesn't help (even if I subtract an exact multiple of days, there are cases where a timezone could cause a multiple of 24 hours to bypass a 23-hour day or get trapped by a 25-hour day). You are best off trying to start from a middle of a month to guarantee that even with the fuzz you still land in the desired destination. $ date --date=3D"$(date "+%b 15") -6 month" +%b%Y Apr2013 $ date --date=3D"$(date "+%b 15") -7 month" +%b%Y Mar2013 $ date --date=3D"$(date "+%b 15") -8 month" +%b%Y Feb2013 $ date --date=3D"$(date "+%b 15") -9 month" +%b%Y Jan2013 As such, I'm closing this as not a bug, although you may feel free to add further comments. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xWNWjSnKtqRKKtJ9m8m5X5b4ohwC8qAdm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJScHatAAoJEKeha0olJ0NqvJ8H/2sKMm2mjaonAK7SprA94MCG 5HWgCMh7jfJXyJF+uexPgGFc/prmSlkWn19NO5Q/0uLJSso2w3b1sfn3BEEqF+hu nwKzp4zvHrXrYwrR+lSJQPVh5z1Bl7WURKUMJkQ641pvc0AFdZHol/tLwDFaZ1F6 4blkRuM9FFnyL7mDG1rE03CnImHPlDxmN3gcBnEyN1olJlIStYYeTPVcY3lgc+Pk zqTW0MT8zAzwsUIWM6TWCdBdLZfDnqSMER/eSq5tjysOmtqmuehP33NGLE10qx+/ OclaTXYkmGLB2KzSCuGkgY6dQfaHt1v4h/Hs9rrWfR6u4n/+0xUzmfE8peUXBS4= =Qc7T -----END PGP SIGNATURE----- --xWNWjSnKtqRKKtJ9m8m5X5b4ohwC8qAdm-- From unknown Sat Aug 16 22:47:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 27 Nov 2013 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