From unknown Fri Aug 15 04:03:35 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#10413 <10413@debbugs.gnu.org> To: bug#10413 <10413@debbugs.gnu.org> Subject: Status: Invalid date result in specific date operations Reply-To: bug#10413 <10413@debbugs.gnu.org> Date: Fri, 15 Aug 2025 11:03:35 +0000 retitle 10413 Invalid date result in specific date operations reassign 10413 coreutils submitter 10413 Vicente P=C3=A9rez M severity 10413 normal tag 10413 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 16:19:31 2011 Received: (at submit) by debbugs.gnu.org; 31 Dec 2011 21:19:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rh6Kx-0002ju-1j for submit@debbugs.gnu.org; Sat, 31 Dec 2011 16:19:31 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RgKMQ-00005U-SG for submit@debbugs.gnu.org; Thu, 29 Dec 2011 13:05:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgKJZ-0001xs-H9 for submit@debbugs.gnu.org; Thu, 29 Dec 2011 13:02:54 -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 autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:58951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgKJZ-0001xk-ER for submit@debbugs.gnu.org; Thu, 29 Dec 2011 13:02:53 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgKJY-00088v-2P for bug-coreutils@gnu.org; Thu, 29 Dec 2011 13:02:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgKJX-0001xF-4d for bug-coreutils@gnu.org; Thu, 29 Dec 2011 13:02:52 -0500 Received: from www.vianauta.com ([200.55.219.188]:40653 helo=hermes.citymovil.cl) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgKJW-0001wW-V5 for bug-coreutils@gnu.org; Thu, 29 Dec 2011 13:02:51 -0500 Received: from [192.168.2.248] (unknown [190.98.201.18]) by hermes.citymovil.cl (Postfix) with ESMTP id E21B727F3F7 for ; Thu, 29 Dec 2011 15:02:46 -0300 (CLST) Message-ID: <4EFCAB45.8000802@citymovil.cl> Date: Thu, 29 Dec 2011 15:02:46 -0300 From: =?ISO-8859-1?Q?Vicente_P=E9rez_M?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Invalid date result in specific date operations Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 31 Dec 2011 16:19:30 -0500 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.6 (------) How to repeat: date -d '2011-08-21 + 1 DAY' +%Y-%m-%d date -d '2010-10-10 + 1 DAY' +%Y-%m-%d These dates is just when change from normal time UTC-4 to dts UCT-3 result: invalid date The same operation with --utc works fine. date -d '2011-08-21 + 1 DAY' +%Y-%m-%d --utc date -d '2010-10-10 + 1 DAY' +%Y-%m-%d --utc From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 17:43:23 2011 Received: (at control) by debbugs.gnu.org; 31 Dec 2011 22:43:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rh7e2-0004h0-QI for submit@debbugs.gnu.org; Sat, 31 Dec 2011 17:43:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rh7ds-0004gg-9g; Sat, 31 Dec 2011 17:43:13 -0500 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 pBVMe1AE007981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 31 Dec 2011 17:40:01 -0500 Received: from [10.3.113.16] ([10.3.113.16]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pBVMdx0T011856; Sat, 31 Dec 2011 17:39:59 -0500 Message-ID: <4EFF8F3E.8000509@redhat.com> Date: Sat, 31 Dec 2011 15:39:58 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Vicente_P=E9rez_M?= Subject: Re: bug#10413: Invalid date result in specific date operations References: <4EFCAB45.8000802@citymovil.cl> In-Reply-To: <4EFCAB45.8000802@citymovil.cl> X-Enigmail-Version: 1.3.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig1C98F715DBE6C7A8D4000F87" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: control Cc: 10413-done@debbugs.gnu.org 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: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1C98F715DBE6C7A8D4000F87 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable tag 10413 notabug thanks On 12/29/2011 11:02 AM, Vicente P=E9rez M wrote: > How to repeat: >=20 >=20 > date -d '2011-08-21 + 1 DAY' +%Y-%m-%d > date -d '2010-10-10 + 1 DAY' +%Y-%m-%d >=20 > These dates is just when change from normal time UTC-4 to dts UCT-3 >=20 > result: invalid date >=20 > The same operation with --utc works fine. > date -d '2011-08-21 + 1 DAY' +%Y-%m-%d --utc > date -d '2010-10-10 + 1 DAY' +%Y-%m-%d --utc Thanks for the report. You failed to mention your exact TZ settings, although you hinted at it via 'dts UTC-3', but the behavior you observed is by design and not a bug. In particular time zones, attempts to land in a time that falls during the skipped hour are rejected, and using UTC (which has no daylight savings) is a correct way to avoid the issue. Another way is to pinpoint times to noon rather than the default of midnight (no known time zone has a daylight savings transition at noon), since your particular time zone appears to be among those zones where the daylight savings rules kick in at midnight: date -d '2011-08-21 12:00pm + 1 day' +%Y-%m-%d More on this topic can be found in the FAQ: https://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-worki= ng-right_002e --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig1C98F715DBE6C7A8D4000F87 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.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJO/48+AAoJEKeha0olJ0NqExwH/1K24QiojItqc7hJi6tNrjNz sBthkzDLcun8wKQ2+RELy2wJCAXNfB2THUtUGzKzpu+84/VG1boJzDbvbRAn/GU+ UtxNFAxNlLGc54OHEYl1gL1Dh/dlT2pnjryT3pi56nPYvZcxxFz29n20VyQvrDPa QHMP80zSqpvE1Leny7ol68VZKcZpNguV1BxqiMSxpltL06MXeHZCEJ82uA/sXeHX 4lWw7pkCT+3e/sl6vzbRyAUCdA3xaQn6sGIc63ne4S0fhtJGop/SVFq47qGq5rVq AafMx0u/piJ1Imt5kGjoewFDTQf4GJibFOdZDwTTDZNYxCaOk/jiQy1ccqus508= =zSW4 -----END PGP SIGNATURE----- --------------enig1C98F715DBE6C7A8D4000F87-- From unknown Fri Aug 15 04:03:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 29 Jan 2012 12:24:02 +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