From unknown Sun Jul 27 03:20:08 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23664 <23664@debbugs.gnu.org> To: bug#23664 <23664@debbugs.gnu.org> Subject: Status: Date Problem: Wrong return using last month today (2016-05-31) Reply-To: bug#23664 <23664@debbugs.gnu.org> Date: Sun, 27 Jul 2025 10:20:08 +0000 retitle 23664 Date Problem: Wrong return using last month today (2016-05-31) reassign 23664 coreutils submitter 23664 "Felippe Silvestre" severity 23664 normal tag 23664 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 31 14:28:42 2016 Received: (at submit) by debbugs.gnu.org; 31 May 2016 18:28:42 +0000 Received: from localhost ([127.0.0.1]:48594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7oPB-0000f0-G4 for submit@debbugs.gnu.org; Tue, 31 May 2016 14:28:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7oBb-0000KR-LV for submit@debbugs.gnu.org; Tue, 31 May 2016 14:14:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7oBV-0003oy-BH for submit@debbugs.gnu.org; Tue, 31 May 2016 14:14:34 -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,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7oBV-0003op-8H for submit@debbugs.gnu.org; Tue, 31 May 2016 14:14:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7oBS-0007t9-Ve for bug-coreutils@gnu.org; Tue, 31 May 2016 14:14:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7oBP-0003nM-O6 for bug-coreutils@gnu.org; Tue, 31 May 2016 14:14:30 -0400 Received: from hm1481-n-158.locaweb.com.br ([189.126.112.158]:34662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7oBP-0003mq-En for bug-coreutils@gnu.org; Tue, 31 May 2016 14:14:27 -0400 Received: from mcbain0001.correio.biz (189.126.112.11) by hm1481.locaweb.com.br id h9na86169v0q for ; Tue, 31 May 2016 15:14:20 -0300 (envelope-from ) Received: from bart0124.email.locaweb.com.br (bart0124.email.locaweb.com.br [10.50.0.23]) by mcbain0001.correio.biz (Postfix) with ESMTP id CD1552C722 for ; Tue, 31 May 2016 15:14:20 -0300 (BRT) X-AuthUser: silvestre@redeservice.com.br X-LocaWeb-COR: locaweb_2009_x-mail Received: from silvestrenb (unknown [186.230.32.171]) (Authenticated sender: silvestre@redeservice.com.br) by bart0124.email.locaweb.com.br (Postfix) with ESMTPA id BB253B5B9847 for ; Tue, 31 May 2016 15:14:20 -0300 (BRT) From: "Felippe Silvestre" To: Subject: Date Problem: Wrong return using last month today (2016-05-31) Date: Tue, 31 May 2016 15:14:18 -0300 Message-ID: <002701d1bb68$3fbf7580$bf3e6080$@com.br> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0028_01D1BB4F.1A723D80" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdG7aD+EMUMB3cV1RuGMgDYsc6mP4w== Content-Language: pt-br X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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.3 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 31 May 2016 14:28:40 -0400 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.3 (----) This is a multi-part message in MIME format. ------=_NextPart_000_0028_01D1BB4F.1A723D80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit [root@superdssbox999 ~]# date Tue May 31 15:10:47 BRT 2016 [root@superdssbox999 ~]# date -d"last month" Sun May 1 15:10:52 BRT 2016 [root@superdssbox999 ~]# date -d"last day last month" Sat Apr 30 15:10:54 BRT 2016 [root@superdssbox999 ~]# Atte. Felippe Silvestre ------=_NextPart_000_0028_01D1BB4F.1A723D80 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[root@superdssbox999 ~]# date

Tue May 31 15:10:47 BRT 2016

 

[root@superdssbox999 ~]# date -d"last = month"

Sun May  1 15:10:52 BRT = 2016

 

[root@superdssbox999 ~]# date -d"last day last = month"

Sat Apr 30 15:10:54 BRT = 2016

[root@superdssbox999 = ~]#

 

Atte.

 

=

Felippe = Silvestre

------=_NextPart_000_0028_01D1BB4F.1A723D80-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 31 15:32:13 2016 Received: (at control) by debbugs.gnu.org; 31 May 2016 19:32:13 +0000 Received: from localhost ([127.0.0.1]:48652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7pOf-0002FO-Ki for submit@debbugs.gnu.org; Tue, 31 May 2016 15:32:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7pOd-0002F5-JW; Tue, 31 May 2016 15:32:12 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E81FC049D52; Tue, 31 May 2016 19:32:05 +0000 (UTC) Received: from [10.3.116.22] (ovpn-116-22.phx2.redhat.com [10.3.116.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4VJW4QI002040; Tue, 31 May 2016 15:32:04 -0400 Subject: Re: bug#23664: Date Problem: Wrong return using last month today (2016-05-31) To: Felippe Silvestre , 23664-done@debbugs.gnu.org References: <002701d1bb68$3fbf7580$bf3e6080$@com.br> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <574DE6B4.60207@redhat.com> Date: Tue, 31 May 2016 13:32:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <002701d1bb68$3fbf7580$bf3e6080$@com.br> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0XIjHraWmRBtobqefxvl16tQa8cLCS1cD" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 31 May 2016 19:32:05 +0000 (UTC) X-Spam-Score: -6.4 (------) 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: -6.4 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0XIjHraWmRBtobqefxvl16tQa8cLCS1cD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 23664 notabug thanks On 05/31/2016 12:14 PM, Felippe Silvestre wrote: > [root@superdssbox999 ~]# date >=20 > Tue May 31 15:10:47 BRT 2016 >=20 > =20 >=20 > [root@superdssbox999 ~]# date -d"last month" >=20 > Sun May 1 15:10:52 BRT 2016 You've hit a FAQ; relative date terms like "last month" are easier to code if they merely add a fixed amount of 30 days, rather than a variable logical amount, particularly since the amount that would be variable may depend on things like daylight savings changes. https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-co= mmand-is-not-working-right_002e There is work underway to add a 'date --debug' option that will make it more obvious HOW date is arriving at its results when presented with inherently ambiguous requests, such as using "last month" near the boundary of a month. I'm closing out this particular request in the bug database, since it is known behavior, but feel free to add more comments or even provide a reason that it should be reopened if what has been mentioned above is insufficient to help you with your use of 'date'. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0XIjHraWmRBtobqefxvl16tQa8cLCS1cD 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/ iQEcBAEBCAAGBQJXTea0AAoJEKeha0olJ0NqYZgH/RLXHl8U/kogODV+QH7dj17p Xvp3zTs44FHGJJkiB7KCOjjZZH1Bm9ygz0Ql8VDK5SWJb1dLxfZJxV4RY+21k49z znWwipyH3quWdL6LGPTX6TFLa1gxC7yxOO4C2cwhLn9sXMTUgfd6g/Sb6VzJbMil D/Me6NZv2VEfgyFSXYnZZHWU+0LaQJ+5WzDgbh9zdPAgcsA2s5vNhyxm459S3sK5 WU78fHk7q/YSG/ocLzC6NJvEljvUWsO5FX3RY6CH95nfx1n/SvCvaxoCl83mOHWe 4i0LGuAb6XlcwMfhT2hwZeVhpbQqXgQvUn4wN1+UVdHXK0NGYOcnPmd9WtfLwt4= =O38O -----END PGP SIGNATURE----- --0XIjHraWmRBtobqefxvl16tQa8cLCS1cD-- From unknown Sun Jul 27 03:20:08 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, 29 Jun 2016 11:24:03 +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