From unknown Sun Aug 10 09:46:41 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#8648 <8648@debbugs.gnu.org> To: bug#8648 <8648@debbugs.gnu.org> Subject: Status: bug in date? Reply-To: bug#8648 <8648@debbugs.gnu.org> Date: Sun, 10 Aug 2025 16:46:41 +0000 retitle 8648 bug in date? reassign 8648 coreutils submitter 8648 "Turner, Neil" severity 8648 normal tag 8648 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 10 19:52:53 2011 Received: (at submit) by debbugs.gnu.org; 10 May 2011 23:52:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJwjV-0006Oz-2N for submit@debbugs.gnu.org; Tue, 10 May 2011 19:52:53 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJwTy-00063G-Vk for submit@debbugs.gnu.org; Tue, 10 May 2011 19:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJwTs-0001nP-Mk for submit@debbugs.gnu.org; Tue, 10 May 2011 19:36:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:33549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJwTs-0001nL-Iu for submit@debbugs.gnu.org; Tue, 10 May 2011 19:36:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:37439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJwTr-0007Cw-G6 for bug-coreutils@gnu.org; Tue, 10 May 2011 19:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJwTq-0001n9-EK for bug-coreutils@gnu.org; Tue, 10 May 2011 19:36:43 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:47197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJwTq-0001n5-9v for bug-coreutils@gnu.org; Tue, 10 May 2011 19:36:42 -0400 X-IronPort-AV: E=Sophos;i="4.64,348,1301875200"; d="scan'208,217";a="697610564" Received: from smtp-in-0105.sea3.amazon.com ([10.224.19.45]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 May 2011 23:36:39 +0000 Received: from ex-hub-9001.ant.amazon.com (ex-hub-9001.sea19.amazon.com [10.185.10.26]) by smtp-in-0105.sea3.amazon.com (8.13.8/8.13.8) with ESMTP id p4ANadK4010700 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 10 May 2011 23:36:39 GMT Received: from ex-sea19-a.ant.amazon.com ([fe80::c166:24c3:f8db:b212]) by ex-hub-9001.ant.amazon.com ([::1]) with mapi; Tue, 10 May 2011 16:36:39 -0700 From: "Turner, Neil" To: "bug-coreutils@gnu.org" Date: Tue, 10 May 2011 16:36:38 -0700 Subject: bug in date? Thread-Topic: bug in date? Thread-Index: AcwPaxt+Qa0Kna3CRb2RNca0mZDybw== Message-ID: <2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66@EX-SEA19-A.ant.amazon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66EXSEA19Aantamaz_" MIME-Version: 1.0 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 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 10 May 2011 19:52:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) --_000_2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66EXSEA19Aantamaz_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Maybe found a bug in date... the following command: $ date --date=3D"yesterday 00:00 +1 day" Mon May 9 16:59:00 PDT 2011 The date as I type this is May 10th... so I was expecting the output to be: Tues May 10 00:00:00 PDT 2011 Thanks, Neil --_000_2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66EXSEA19Aantamaz_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Maybe found a bu= g in date…  the following command: 

 

$ date --date=3D&quo= t;yesterday 00:00 +1 day"

Mon May&n= bsp; 9 16:59:00 PDT 2011

 

The date as I type this is May 10th&#= 8230; so I was expecting the output to be:

Tues May  10 00:00:00 PDT 2011

<= o:p> 

Thanks,

 

Neil

 

 =

= --_000_2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66EXSEA19Aantamaz_-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 00:32:08 2011 Received: (at 8648) by debbugs.gnu.org; 11 May 2011 04:32:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK15k-00046Q-3R for submit@debbugs.gnu.org; Wed, 11 May 2011 00:32:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK15h-00045w-PS for 8648@debbugs.gnu.org; Wed, 11 May 2011 00:32:06 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4B4Vw2R007822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 May 2011 00:31:59 -0400 Received: from [10.36.7.98] (vpn1-7-98.ams2.redhat.com [10.36.7.98]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4B4Vvem013635; Wed, 11 May 2011 00:31:58 -0400 Subject: Re: bug#8648: bug in date? From: Ondrej Vasik To: "Turner, Neil" In-Reply-To: <2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66@EX-SEA19-A.ant.amazon.com> References: <2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66@EX-SEA19-A.ant.amazon.com> Content-Type: text/plain; charset="UTF-8" Organization: Red Hat, Inc. Date: Wed, 11 May 2011 06:31:56 +0200 Message-ID: <1305088316.17000.20.camel@dhcp-24-196.brq.redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -9.7 (---------) X-Debbugs-Envelope-To: 8648 Cc: 8648@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: ovasik@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -9.7 (---------) On Tue, 2011-05-10 at 16:36 -0700, Turner, Neil wrote: > Maybe found a bug in date... the following command: > > $ date --date="yesterday 00:00 +1 day" > Mon May 9 16:59:00 PDT 2011 > > The date as I type this is May 10th... so I was expecting the output to be: > Tues May 10 00:00:00 PDT 2011 First of all, please always report the version of coreutils where you experience the unexpected behaviour. However - it is a tricky thing - you are human, you know what you have meant by +1 ... but flex getdate parser is not a human - and it simply parses the date format. In this case date format expects +1 is timezone (and because I see the offset of 1 minute, I think you have quite old version of coreutils). +1 is then implicit for the relative time offset (you may consider date --date="yesterday 00:00 +3 day" to be even more "buggy"). Not too much to do, date parser is very fragile and you will always have this kind of disambiguations there. So there is only one hint, make the format as complete as possible (date time timezone offset)... With `date --date="yesterday 00:00 PDT +1 day"` you should get the date you expected. Greetings, Ondrej Vasik From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 02:00:43 2011 Received: (at 8648) by debbugs.gnu.org; 11 May 2011 06:00:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK2TT-00065A-19 for submit@debbugs.gnu.org; Wed, 11 May 2011 02:00:43 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK2TP-00064v-KF for 8648@debbugs.gnu.org; Wed, 11 May 2011 02:00:40 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id CD6136019D; Wed, 11 May 2011 08:00:33 +0200 (CEST) From: Jim Meyering To: "Turner Neil" Subject: Re: bug#8648: bug in date? In-Reply-To: <1305088316.17000.20.camel@dhcp-24-196.brq.redhat.com> (Ondrej Vasik's message of "Wed, 11 May 2011 06:31:56 +0200") References: <2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66@EX-SEA19-A.ant.amazon.com> <1305088316.17000.20.camel@dhcp-24-196.brq.redhat.com> Date: Wed, 11 May 2011 08:00:33 +0200 Message-ID: <87y62dvkse.fsf@rho.meyering.net> Lines: 49 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8648 Cc: 8648@debbugs.gnu.org, ovasik@redhat.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) tag 8648 + notabug close 8648 thanks Ondrej Vasik wrote: > On Tue, 2011-05-10 at 16:36 -0700, Turner, Neil wrote: >> Maybe found a bug in date... the following command: >> >> $ date --date=3D"yesterday 00:00 +1 day" >> Mon May 9 16:59:00 PDT 2011 >> >> The date as I type this is May 10th... so I was expecting the output to = be: >> Tues May 10 00:00:00 PDT 2011 > > First of all, please always report the version of coreutils where you > experience the unexpected behaviour. > > However - it is a tricky thing - you are human, you know what you have > meant by +1 ... but flex getdate parser is not a human - and it simply > parses the date format. In this case date format expects +1 is timezone > (and because I see the offset of 1 minute, I think you have quite old > version of coreutils). +1 is then implicit for the relative time offset > (you may consider date --date=3D"yesterday 00:00 +3 day" to be even more > "buggy"). Not too much to do, date parser is very fragile and you will > always have this kind of disambiguations there. So there is only one > hint, make the format as complete as possible (date time timezone > offset)... > > With `date --date=3D"yesterday 00:00 PDT +1 day"` you should get the date > you expected. Thanks for the report, Neil, and for replying, Ond=C5=99ej. Neil, if you run "info date example", you'll see pretty many examples. There are some here, too: http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-comma= nd-is-not-working-right_002e BTW, simply removing the "+" should make date do what you want most of the time: $ date --date=3D"yesterday 00:00 1 day" However, that may well fail around DST changes (as explained in detail via that FAQ), so you should use noon rather than midnight: $ date --date=3D"yesterday 12:00 1 day" P.S. I've closed this ticket but you're welcome to continue discussing and even to reopen it if I've missed something. From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 12:39:57 2011 Received: (at control) by debbugs.gnu.org; 11 May 2011 16:39:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKCS5-0004rI-8K for submit@debbugs.gnu.org; Wed, 11 May 2011 12:39:57 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKCS3-0004r6-Ao for control@debbugs.gnu.org; Wed, 11 May 2011 12:39:56 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 99BEF6021D; Wed, 11 May 2011 18:39:49 +0200 (CEST) From: Jim Meyering To: control@debbugs.gnu.org Subject: Re: bug#8648: bug in date? In-Reply-To: <87y62dvkse.fsf@rho.meyering.net> (Jim Meyering's message of "Wed, 11 May 2011 08:00:33 +0200") References: <2ACA5D24A0D78040A739A36B5EE9F4B3125FBD66@EX-SEA19-A.ant.amazon.com> <1305088316.17000.20.camel@dhcp-24-196.brq.redhat.com> <87y62dvkse.fsf@rho.meyering.net> Date: Wed, 11 May 2011 18:39:49 +0200 Message-ID: <8739kltcmi.fsf@rho.meyering.net> Lines: 3 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) tags 8648 + notabug close 8648 thanks From unknown Sun Aug 10 09:46:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 Jun 2011 11: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