From unknown Sat Jun 21 03:15:18 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#13938 <13938@debbugs.gnu.org> To: bug#13938 <13938@debbugs.gnu.org> Subject: Status: Bug: date(1) -d "relative-to-skipped-time" problem (also in touch(1) -d) Reply-To: bug#13938 <13938@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:15:18 +0000 retitle 13938 Bug: date(1) -d "relative-to-skipped-time" problem (also in t= ouch(1) -d) reassign 13938 coreutils submitter 13938 Ale=C5=A1 Kantor severity 13938 normal tag 13938 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 12 18:51:57 2013 Received: (at submit) by debbugs.gnu.org; 12 Mar 2013 22:51:57 +0000 Received: from localhost ([127.0.0.1]:49652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFY2z-0001l1-J7 for submit@debbugs.gnu.org; Tue, 12 Mar 2013 18:51:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48388) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFXJe-00089T-47 for submit@debbugs.gnu.org; Tue, 12 Mar 2013 18:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFXF3-0002Jz-6B for submit@debbugs.gnu.org; Tue, 12 Mar 2013 18:03:55 -0400 Received: from lists.gnu.org ([208.118.235.17]:37085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFXF3-0002Jv-3e for submit@debbugs.gnu.org; Tue, 12 Mar 2013 18:00:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFXAj-0006w2-65 for bug-coreutils@gnu.org; Tue, 12 Mar 2013 18:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFX9f-0000Go-2W for bug-coreutils@gnu.org; Tue, 12 Mar 2013 17:55:49 -0400 Received: from pdx3.collegenet.com ([74.122.104.13]:60655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFX9e-0008Sj-OK for bug-coreutils@gnu.org; Tue, 12 Mar 2013 17:54:42 -0400 Received: from [10.1.2.222] ([10.1.2.222]) by pdx3.collegenet.com (Lotus Domino Release 8.5.3FP3) with ESMTP id 2013031214535938-20713 ; Tue, 12 Mar 2013 14:53:59 -0700 Message-ID: <513FA426.4050506@collegenet.com> Date: Tue, 12 Mar 2013 14:54:46 -0700 From: =?windows-1252?Q?Ale=9A_Kantor?= Organization: CollegeNET User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Bug: date(1) -d "relative-to-skipped-time" problem (also in touch(1) -d) X-MIMETrack: Itemize by SMTP Server on pdx3/UAI(Release 8.5.3FP3|November 15, 2012) at 03/12/2013 02:53:59 PM, Serialize by Router on pdx3/UAI(Release 8.5.3FP3|November 15, 2012) at 03/12/2013 02:54:41 PM X-TNEFEvaluated: 1 Content-Type: multipart/alternative; boundary="------------060108090404080703070900" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 12 Mar 2013 18:51:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.9 (------) --------------060108090404080703070900 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Set date to Mar 10, 2013 (the day clocks moved fwd) This command date -d 2:30am gives "Invalid date," probably reasonable, since that time didn't exist. This one should work, but fails as well: date -d "2:00am yesterday" date: invalid date `2:00am yesterday' Any =5Frelative=5F reference to the missing chunk of time will produce an e= rror. Regards, Ale=9A Kantor IT System Administrator CollegeNET, Inc date (GNU coreutils) 8.13 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later=20 . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. touch (GNU coreutils) 8.13 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later=20 . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith. cat /etc/debian=5Fversion 7.0 root@ft:~# date -d "2:00am yesterday" date: invalid date `2:00am yesterday' root@ft:~# date -d "2:00am Monday" date: invalid date `2:00am Monday' root@ft:~# date -d "2:10am Monday" date: invalid date `2:10am Monday' root@ft:~# date -d "2:10am Jan 1" Tue Jan 1 02:10:00 PST 2013 root@ft:~# date -d "2:10am yesterday" date: invalid date `2:10am yesterday' root@ft:~# date -d "2:10am tomorrow" date: invalid date `2:10am tomorrow' root@ft:~# date -d "2:10am next week" date: invalid date `2:10am next week' root@ft:~# date -d "1:10am next week" Sun Mar 17 01:10:00 PDT 2013 --------------060108090404080703070900 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Set date to Mar 10, 2013=A0 (the day clocks moved fwd)

This command
=A0=A0=A0 date -d 2:30am
gives "Invalid date," probably reasonable, since that time didn't exist.

This one should work, but fails as well:
=A0 date=A0 -d "2:00am yesterday"
date: invalid date `2:00am yesterday'


Any relative reference to the missing chunk of time will produce an error.

Regards,

Ale=9A Kantor
IT System Administrator
CollegeNET, Inc




date (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

touch (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, Arnold Robbins, Jim Kingdon,
David MacKenzie, and Randy Smith.

cat /etc/debian=5Fversion
7.0




root@ft:~# date=A0 -d "2:00am yesterday"
date: invalid date `2:00am yesterday'
root@ft:~# date=A0 -d "2:00am Monday"
date: invalid date `2:00am Monday'
root@ft:~# date=A0 -d "2:10am Monday"
date: invalid date `2:10am Monday'

root@ft:~# date=A0 -d "2:10am Jan 1"
Tue Jan=A0 1 02:10:00 PST 2013
root@ft:~# date=A0 -d "2:10am yesterday"
date: invalid date `2:10am yesterday'
root@ft:~# date=A0 -d "2:10am tomorrow"
date: invalid date `2:10am tomorrow'
root@ft:~# date=A0 -d "2:10am next week"
date: invalid date `2:10am next week'
root@ft:~# date=A0 -d "1:10am next week"
Sun Mar 17 01:10:00 PDT 2013

--------------060108090404080703070900-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 13 01:24:37 2013 Received: (at 13938) by debbugs.gnu.org; 13 Mar 2013 05:24:37 +0000 Received: from localhost ([127.0.0.1]:49977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFeB2-0002Mp-Jr for submit@debbugs.gnu.org; Wed, 13 Mar 2013 01:24:37 -0400 Received: from joseki.proulx.com ([216.17.153.58]:53315) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFeAy-0002Md-Bg; Wed, 13 Mar 2013 01:24:35 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id B8DDB211D5; Tue, 12 Mar 2013 23:23:27 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id A40672DCE0; Tue, 12 Mar 2013 23:23:27 -0600 (MDT) Date: Tue, 12 Mar 2013 23:23:27 -0600 From: Bob Proulx To: =?utf-8?B?QWxlxaE=?= Kantor Subject: Re: bug#13938: Bug: date(1) -d "relative-to-skipped-time" problem (also in touch(1) -d) Message-ID: <20130313052327.GA32607@hysteria.proulx.com> References: <513FA426.4050506@collegenet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <513FA426.4050506@collegenet.com> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 13938 Cc: 13938@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -2.6 (--) tag 13938 + moreinfo thanks Ale=C5=A1 Kantor wrote: > Set date to Mar 10, 2013 (the day clocks moved fwd) In which timezone? Please tell us what timezone you are in because the tzdata is different for everyone. Instead of setting the time simply include the date in the timestamp. But for the purpose of recreating the problem please do include the timezone too. The -R,--rfc-2822 option is good to use to avoid the ambiguous timezone naming used in the traditional legacy output. $ env TZ=3DUS/Mountain date -R -d "2013-03-10 12:00" Sun, 10 Mar 2013 12:00:00 -0600 > This command > date -d 2:30am > gives "Invalid date," probably reasonable, since that time didn't exist= . Correct. In US timezones at least that time does not exist. > This one should work, but fails as well: > date -d "2:00am yesterday" > date: invalid date `2:00am yesterday' You didn't say what timezone you are using. I will assume a US timezone until I learn otherwise. That is correct behavior in the my own timezone. The tzdata zone can be dumped using the zdump command. $ zdump -v US/Mountain | grep 2013 US/Mountain Sun Mar 10 08:59:59 2013 UTC =3D Sun Mar 10 01:59:59 2013 = MST isdst=3D0 gmtoff=3D-25200 US/Mountain Sun Mar 10 09:00:00 2013 UTC =3D Sun Mar 10 03:00:00 2013 = MDT isdst=3D1 gmtoff=3D-21600 US/Mountain Sun Nov 3 07:59:59 2013 UTC =3D Sun Nov 3 01:59:59 2013 = MDT isdst=3D1 gmtoff=3D-21600 US/Mountain Sun Nov 3 08:00:00 2013 UTC =3D Sun Nov 3 01:00:00 2013 = MST isdst=3D0 gmtoff=3D-25200 This shows that last second before is "Sun Mar 10 01:59:59 2013 MST" and the next second after that one is "Sun Mar 10 03:00:00 2013 MDT". Since 2:00am does not exist it is an invalid timezone. All references to it are invalid in the specified timezone. > Any _relative_ reference to the missing chunk of time will produce an e= rror. > ... > root@ft:~# date -d "2:00am yesterday" > date: invalid date `2:00am yesterday' > root@ft:~# date -d "2:00am Monday" > date: invalid date `2:00am Monday' > root@ft:~# date -d "2:10am Monday" > date: invalid date `2:10am Monday' > root@ft:~# date -d "2:10am Jan 1" > Tue Jan 1 02:10:00 PST 2013 > root@ft:~# date -d "2:10am yesterday" > date: invalid date `2:10am yesterday' > root@ft:~# date -d "2:10am tomorrow" > date: invalid date `2:10am tomorrow' > root@ft:~# date -d "2:10am next week" > date: invalid date `2:10am next week' > root@ft:~# date -d "1:10am next week" > Sun Mar 17 01:10:00 PDT 2013 All correct. A relative reference to an invalid time is still an invalid time. $ env TZ=3DUS/Mountain date -R -d "2013-03-10 1:59" Sun, 10 Mar 2013 01:59:00 -0700 $ env TZ=3DUS/Mountain date -R -d "2013-03-10 1:59 -1 day" Sun, 10 Mar 2013 20:59:00 -0600 That timestamp exists. All good. But 2am does not exist. It is invalid. $ env TZ=3DUS/Mountain date -R -d "2013-03-10 2:00" date: invalid date =E2=80=982013-03-10 2:00=E2=80=99 $ env TZ=3DUS/Mountain date -R -d "2013-03-10 2:00 yesterday" date: invalid date =E2=80=982013-03-10 2:00 yesterday=E2=80=99 Since 2am is invalid then any time relative to the invalid time is also invalid. It does not exist therefore describing another time as relative to a nonexistent time is also nonexistent. To avoid these types of problems it is best to use UTC. If the local time must be used then using a time around 12:00 noon should avoid all DST changes in practice. $ env TZ=3DUS/Mountain date -u -R -d "2013-03-10 yesterday" Sat, 09 Mar 2013 00:00:00 +0000 $ env TZ=3DUS/Mountain date -R -d "2013-03-10 12:00 yesterday" Sat, 09 Mar 2013 12:00:00 -0700 Please see the date FAQ entry. This topic is described in more detail there. http://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-work= ing-right_002e Bob From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 23 18:37:46 2018 Received: (at 13938) by debbugs.gnu.org; 23 Oct 2018 22:37:46 +0000 Received: from localhost ([127.0.0.1]:38757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gF5J4-0002yR-HU for submit@debbugs.gnu.org; Tue, 23 Oct 2018 18:37:46 -0400 Received: from mail-it1-f172.google.com ([209.85.166.172]:40672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gF5J2-0002y8-NT; Tue, 23 Oct 2018 18:37:45 -0400 Received: by mail-it1-f172.google.com with SMTP id i191-v6so4210921iti.5; Tue, 23 Oct 2018 15:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=EF13p88IHPL5ac5rI8R4ewdBc/j8UctUVgHBcOiJpgY=; b=Z1++62LCZGdSChXVZjjhxNsjSJ4u1wsTu1CHtiOskr0atG5mPuTgLhhksGanODflaG 505bKsPov39JQx6eQ61RUjWg9vnDNcV+E99GDRpl647rOoUqBdRUMI6pAutNzl8BCFox 1XIyGbukMO0WNFNbNXRcAx6+lcPCnYkWnmnidEELBZhmpIV6H1ljS6NgjJXDSz6y2P+L pUJFae/5pZPET9QCptQfIHxnc0D3MsnEui4lPYdV3obxiD55v3oiBp/nZvYg8iH6tjwT yf00c+Ny5jxly5MAPeaVnl0lcSs9hwpOi+oUhYTetZw1+4KRWoD5Cm1fdtLrx1l7GPcD zaaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EF13p88IHPL5ac5rI8R4ewdBc/j8UctUVgHBcOiJpgY=; b=PAWm5+uNADulC0j9QMXRY2C3xh0uNfA4Gxuh8HLRkxgLGLrPHzxSyJ9SCv1OEJb65K ye9c5rSdEnxEHI6dhGCZQLJE//qhkemYidyWmGYPAt5r/Ss7Q2IY2zLUTBis+jNFX9cf RfgpN3E6QJkl64G++mfP7cgyeO7BCN+LAOGhlE2EtgkzqlEc2wbt9S4H0LUEKoAq60kn MGjY/i1ZWs+uLdxPkAFVg678eu0Xe9idE+wrtHQCWaInDo3NGZe675DCQsBBfKXIrlKX rIYlb4QsBgSkFEbNir7vdeqq3bPeulcnd6Pnp2523z0EL5AJwTh6IsCZpplEGlPQ6DiL ovDw== X-Gm-Message-State: AGRZ1gLg3MHQf3VUTHZoe8IG0AB5BLLSmoxB3PSYzuHNH16tGBlpnRw2 tRlc39cKcsESA63fXjirsF+WdhycwqE= X-Google-Smtp-Source: AJdET5d2PLURSBnquFdWt1+LEmfTglEPV/ik3cgGf+EFIrslc/S/JW/ZaefBw1k0J7Uhz2ZHcTtmHw== X-Received: by 2002:a02:9804:: with SMTP id t4-v6mr155154jaj.136.1540334258456; Tue, 23 Oct 2018 15:37:38 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id u206-v6sm1688685iod.18.2018.10.23.15.37.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 15:37:37 -0700 (PDT) Subject: Re: bug#13938: Bug: date(1) -d "relative-to-skipped-time" problem (also in touch(1) -d) To: 13938@debbugs.gnu.org References: <513FA426.4050506@collegenet.com> <20130313052327.GA32607@hysteria.proulx.com> From: Assaf Gordon Message-ID: <876a55fd-02d9-0b39-0f89-cc382b600364@gmail.com> Date: Tue, 23 Oct 2018 16:37:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20130313052327.GA32607@hysteria.proulx.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13938 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: -1.0 (-) close 13938 stop (triaging old bugs) On 12/03/13 11:23 PM, Bob Proulx wrote: > Aleš Kantor wrote: >> Set date to Mar 10, 2013 (the day clocks moved fwd) > > In which timezone? Please tell us what timezone you are in because > the tzdata is different for everyone. > > Instead of setting the time simply include the date in the timestamp. > But for the purpose of recreating the problem please do include the > timezone too. The -R,--rfc-2822 option is good to use to avoid the > ambiguous timezone naming used in the traditional legacy output. > > $ env TZ=US/Mountain date -R -d "2013-03-10 12:00" > Sun, 10 Mar 2013 12:00:00 -0600 > >> This command >> date -d 2:30am >> gives "Invalid date," probably reasonable, since that time didn't exist. > > Correct. In US timezones at least that time does not exist. > >> This one should work, but fails as well: >> date -d "2:00am yesterday" >> date: invalid date `2:00am yesterday' > With no further comments to Bob's explanation in 5 years, I'm closing this bug. -assaf From unknown Sat Jun 21 03:15:18 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, 21 Nov 2018 12:24:06 +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