From unknown Fri Jun 20 18:24:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15927: Bug in date command Resent-From: Claudio Pinto Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 19 Nov 2013 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15927 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 15927@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138488044922244 (code B ref -1); Tue, 19 Nov 2013 17:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Nov 2013 17:00:49 +0000 Received: from localhost ([127.0.0.1]:33483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViofP-0005mg-Hy for submit@debbugs.gnu.org; Tue, 19 Nov 2013 12:00:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44465) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VikLN-000607-6Q for submit@debbugs.gnu.org; Tue, 19 Nov 2013 07:23:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VikLG-0000jP-W7 for submit@debbugs.gnu.org; Tue, 19 Nov 2013 07:23:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VikLG-0000jC-St for submit@debbugs.gnu.org; Tue, 19 Nov 2013 07:23:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VikLF-0004tm-Qn for bug-coreutils@gnu.org; Tue, 19 Nov 2013 07:23:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VikLE-0000iF-Pe for bug-coreutils@gnu.org; Tue, 19 Nov 2013 07:23:41 -0500 Received: from mail-qa0-x235.google.com ([2607:f8b0:400d:c00::235]:52552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VikLE-0000i4-LA for bug-coreutils@gnu.org; Tue, 19 Nov 2013 07:23:40 -0500 Received: by mail-qa0-f53.google.com with SMTP id j5so1135767qaq.19 for ; Tue, 19 Nov 2013 04:23:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=V4Ri5VgCvqF34366Y1JH8G40iCGL+n5JjYk0AteoD+A=; b=xPetoyq8d3ceBTn10/s7LUq/CPBbEGg+cq/oJO/h0jaSGrfG7i6JYWQZuv5bLpgisi NCplHv61QObrc7V/gHwdoxZxit+z13U9xy1ltfuL+rGaTjMESGG0DRTvLGR+34V0LSjq ewJsnv4EXSFqmG8vC8gsI9/FjDazYJWcNzapp3KES/lZSYaLPIcvjTCbnXIk9sv1EK7J bz4EZDhlR5Ze98YlDuf2lhvHkC0EtVofICvlRHDqMkA3rgY1rCS9ONXpO4Z8Bk/PiDsZ a1FMOO6vOYcI8xUnzstTFKerdHEFeCvlb4DXMYDMzG+3vmDF2c/GXx0A7+YGm3WWa3OQ A7Uw== MIME-Version: 1.0 X-Received: by 10.49.94.177 with SMTP id dd17mr10037494qeb.14.1384863819918; Tue, 19 Nov 2013 04:23:39 -0800 (PST) Received: by 10.224.10.139 with HTTP; Tue, 19 Nov 2013 04:23:39 -0800 (PST) Date: Tue, 19 Nov 2013 10:23:39 -0200 Message-ID: From: Claudio Pinto Content-Type: multipart/alternative; boundary=047d7b6731b20c74cb04eb86bcda X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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: -4.0 (----) X-Mailman-Approved-At: Tue, 19 Nov 2013 12:00:45 -0500 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: -4.0 (----) --047d7b6731b20c74cb04eb86bcda Content-Type: text/plain; charset=ISO-8859-1 date --date=10/20/2013 result in date: invalid date `10/20/2013' version: date (GNU coreutils) 8.13 --047d7b6731b20c74cb04eb86bcda Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
date --date=3D10/20/2013

=
result in=A0

date: invalid date `10/20/2013'

version:

date (GNU coreutils) 8.13
--047d7b6731b20c74cb04eb86bcda-- From unknown Fri Jun 20 18:24:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15927: Bug in date command Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 19 Nov 2013 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15927 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Claudio Pinto , 15927@debbugs.gnu.org Received: via spool by 15927-submit@debbugs.gnu.org id=B15927.1384886796758 (code B ref 15927); Tue, 19 Nov 2013 18:47:02 +0000 Received: (at 15927) by debbugs.gnu.org; 19 Nov 2013 18:46:36 +0000 Received: from localhost ([127.0.0.1]:33556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViqJo-0000C8-3w for submit@debbugs.gnu.org; Tue, 19 Nov 2013 13:46:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63652) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViqJl-0000Bn-KC; Tue, 19 Nov 2013 13:46:35 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAJIkSWW014457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Nov 2013 13:46:29 -0500 Received: from [10.3.113.132] (ovpn-113-132.phx2.redhat.com [10.3.113.132]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAJIkSI1028855; Tue, 19 Nov 2013 13:46:28 -0500 Message-ID: <528BB204.5080701@redhat.com> Date: Tue, 19 Nov 2013 11:46:28 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 References: In-Reply-To: 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="nh3XISbF92R3dCKXNa2dEhJcFaWmvmLof" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -5.5 (-----) 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) --nh3XISbF92R3dCKXNa2dEhJcFaWmvmLof Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 15927 needinfo thanks On 11/19/2013 05:23 AM, Claudio Pinto wrote: > date --date=3D10/20/2013 >=20 > result in >=20 > date: invalid date `10/20/2013' We need more details, such as your current timezone. I suspect that you are running into a FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-co= mmand-is-not-working-right_002e in that you are probably in a timezone where daylight savings changed your time from midnight to 1am at the very start of that particular day, and therefore where there is no effective midnight on that date. But as I don't know what timezone you are in, I haven't managed to reproduce it locally (in my timezone, daylight savings changes occur at 2am rather than midnight). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nh3XISbF92R3dCKXNa2dEhJcFaWmvmLof 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/ iQEcBAEBCAAGBQJSi7IEAAoJEKeha0olJ0NqkZcH/1wWAXKioE07mIZFfeAOmSM9 1yVb6EDRRB+xVKfNtNimM4KxihV6P4pZJp9eLYt2Izrkl5b9qqTagb1Wv/sDn876 2hVWtwWdbjcePMidYAg11+TK6UWfEQ3xHiWYgGM2dWz8iq5/uLgWjgiW2un3w3Yi esnaykiaukQZVisRjBwApbOxygKS/gjiYZntlkUPjBB9G6LHlMHk+jSWUoZHcjrh doFFC2T6v6mgLtlRZAcdTK9zD3YzlOwdjY3S1kT3OG5K78BLUTAm9QM5/qvXBdKx r2Qushq/PL4b2svWdzQKAADY/F1o3CcSNPtnfJQoV4nVFB/XtAFzfjAwVjfnD3s= =SNft -----END PGP SIGNATURE----- --nh3XISbF92R3dCKXNa2dEhJcFaWmvmLof-- From unknown Fri Jun 20 18:24:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15927: Bug in date command Resent-From: Bob Proulx Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 19 Nov 2013 18:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15927 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: moreinfo To: Claudio Pinto Cc: 15927@debbugs.gnu.org Received: via spool by 15927-submit@debbugs.gnu.org id=B15927.1384886832873 (code B ref 15927); Tue, 19 Nov 2013 18:48:01 +0000 Received: (at 15927) by debbugs.gnu.org; 19 Nov 2013 18:47:12 +0000 Received: from localhost ([127.0.0.1]:33564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViqKN-0000E0-Vp for submit@debbugs.gnu.org; Tue, 19 Nov 2013 13:47:12 -0500 Received: from joseki.proulx.com ([216.17.153.58]:38423) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViqKL-0000Dl-1n; Tue, 19 Nov 2013 13:47:10 -0500 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 305B521229; Tue, 19 Nov 2013 11:47:05 -0700 (MST) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 0C2AB2DC77; Tue, 19 Nov 2013 11:47:04 -0700 (MST) Date: Tue, 19 Nov 2013 11:47:04 -0700 From: Bob Proulx Message-ID: <20131119184704.GA26460@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.5 (/) 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: -0.5 (/) tag 15927 + moreinfo thanks Claudio Pinto wrote: > date --date=10/20/2013 > result in > date: invalid date `10/20/2013' In what timezone? You didn't give your timezone therefore it is impossible to know for sure but your problem statement matches one of the very common cases where Daylight Saving Time changes and therefore creates an invalid date in your timezone. Since you don't specify a time the time of 00:00 implicit. Better to work with raw dates around 12:00 noon which avoids all known timezone DST changes. Using the raw 'date' output gives ambiguous timezones. Better to use the standardized and unambiguous -R format. $ date -R --date=10/20/2013 Sun, 20 Oct 2013 00:00:00 -0600 $ date -R --date="10/20/2013 12:00" Sun, 20 Oct 2013 12:00:00 -0600 Even better is to always do date calculations in UTC to avoid any DST problems entirely. $ date -u -R --date=10/20/2013 Sun, 20 Oct 2013 00:00:00 +0000 Please see the FAQ for a detailed discussion of date and DST. http://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e Bob From unknown Fri Jun 20 18:24:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15927: Bug in date command Resent-From: Bob Proulx Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 19 Nov 2013 20:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15927 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: moreinfo To: Claudio Pinto Cc: 15927@debbugs.gnu.org Received: via spool by 15927-submit@debbugs.gnu.org id=B15927.138489209713539 (code B ref 15927); Tue, 19 Nov 2013 20:15:02 +0000 Received: (at 15927) by debbugs.gnu.org; 19 Nov 2013 20:14:57 +0000 Received: from localhost ([127.0.0.1]:33663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VirhI-0003WH-PD for submit@debbugs.gnu.org; Tue, 19 Nov 2013 15:14:57 -0500 Received: from joseki.proulx.com ([216.17.153.58]:38809) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VirhF-0003W0-Jn; Tue, 19 Nov 2013 15:14:55 -0500 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 78F8D21229; Tue, 19 Nov 2013 13:14:49 -0700 (MST) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 127732DC77; Tue, 19 Nov 2013 13:14:48 -0700 (MST) Date: Tue, 19 Nov 2013 13:14:48 -0700 From: Bob Proulx Message-ID: <20131119201448.GA4358@hysteria.proulx.com> Mail-Followup-To: 15927@debbugs.gnu.org, Claudio Pinto References: <20131119184704.GA26460@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.5 (/) 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: -0.5 (/) tag 15927 - moreinfo + notabug close 15927 thanks Hello Claudio, Please keep the bug log in the recipient list. That way others in the team on the mailing list can participate in the discussion. Claudio Pinto wrote: > Current default time zone: 'America/Sao_Paulo' > Local time is now: Ter Nov 19 17:10:40 BRST 2013. > Universal Time is now: Tue Nov 19 19:10:40 UTC 2013. > > Here in Brazil we have the time in an hour early. Yes. And that is the problem. The time you have specified does not exist. That is what makes it an invalid time. $ zdump -v America/Sao_Paulo | grep Oct.*2013 America/Sao_Paulo Sun Oct 20 02:59:59 2013 UTC = Sat Oct 19 23:59:59 2013 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 20 03:00:00 2013 UTC = Sun Oct 20 01:00:00 2013 BRST isdst=1 gmtoff=-7200 In the America/Sao_Paulo timezone as shown above the seconds of the clock tick to "Oct 19 23:59:59 2013 BRT" and the very next tick of the clock is "Sun Oct 20 01:00:00 2013 BRST". But you are asking for "Sun Oct 20 00:00:00" which does not exist in either BRT or BRST. Note that this is not a technology issue. This is an issue of changing the clock for Daylight Saving Time. Most countries do this by an act of government. > Removing a difference an hour, with the command below, the error does not > happen ... > date --date="10/20/2013 01:00" > with the command below error appears: > date --date="10/20/2013 00:59" Correct. Because those are invalid according to your America/Sao_Paulo timezone. To avoid those errors either use UTC which does not change for Daylight Saving Time or use 12:00 noon to avoid being near the time that it changes. Since this is a bug in usage and not a bug in the date calculations I am going to close the bug report. However if things are still not clear please feel free to follow up with any responses or comments and we can keep discussing it. Please keep the bug log address in the recipient list. Bob