GNU bug report logs - #12650
Bug in date command

Previous Next

Package: coreutils;

Reported by: Thiago Picharski <thiagopicharski <at> gmail.com>

Date: Sun, 14 Oct 2012 22:00:01 UTC

Severity: normal

Tags: moreinfo

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12650 in the body.
You can then email your comments to 12650 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#12650; Package coreutils. (Sun, 14 Oct 2012 22:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thiago Picharski <thiagopicharski <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 14 Oct 2012 22:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thiago Picharski <thiagopicharski <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Bug in date command
Date: Sun, 14 Oct 2012 17:29:46 -0300
[Message part 1 (text/plain, inline)]
Hello,

I'm trying run this command "date -d 12-10-21", but occur the follow
error, date: invalid date "12-10-21"
and finalize with error code 1.

Interestingly, when i run "date -d 12-10-20" or "date -d 12-10-22" this
work fine.

Thanks!

Thiago H. S. Picharski
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#12650; Package coreutils. (Sun, 14 Oct 2012 23:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 12650 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: Thiago Picharski <thiagopicharski <at> gmail.com>
Cc: 12650 <at> debbugs.gnu.org
Subject: Re: bug#12650: Bug in date command
Date: Sun, 14 Oct 2012 17:28:19 -0600
tags 12650 + moreinfo
thanks

Thiago Picharski wrote:
> I'm trying run this command "date -d 12-10-21", but occur the follow
> error, date: invalid date "12-10-21"
> and finalize with error code 1.

What timezone are you in?  Almost certainly that timezone experienced
a daylight savings time change and the time you are asking about does
not exist, is invalid.  "Spring forward and Fall back."  When DST
jumps forward then some times will not exist by act of law, not
technology.  Technology says use UTC but people like local time to
change from place to place.  :-)

Please read this reference and let us know if it covers your case or
not.

  http://www.gnu.org/software/coreutils/faq/#The-date-command-is-not-working-right_002e

The basic problem is that when you specify 12-10-21 it means 0000
hours.  That is often when DST changes.  Better to specify noon
instead which is far from when DST changes.

  $ date -d "12-10-21 12:00"

Best would be to work in UTC to avoid DST issues entirely.

  $ date -u -d "12-10-21 12:00 UTC"

> Interestingly, when i run "date -d 12-10-20" or "date -d 12-10-22" this
> work fine.

Very likely those dates are valid.  Since you didn't say what timezone
you are working in I can't look to see what was happening there.

Bob




Added tag(s) moreinfo. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Sun, 14 Oct 2012 23:30:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#12650; Package coreutils. (Tue, 23 Oct 2018 22:13:02 GMT) Full text and rfc822 format available.

Message #13 received at 12650 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 12650 <at> debbugs.gnu.org
Subject: Re: bug#12650: Bug in date command
Date: Tue, 23 Oct 2018 16:12:08 -0600
close 12650
stop

(triaging old bugs)

On 14/10/12 05:28 PM, Bob Proulx wrote:
> 
> Thiago Picharski wrote:
>> I'm trying run this command "date -d 12-10-21", but occur the follow
>> error, date: invalid date "12-10-21"
>> and finalize with error code 1.
> 
> [...]
> The basic problem is that when you specify 12-10-21 it means 0000
> hours.  That is often when DST changes.  Better to specify noon
> instead which is far from when DST changes.
> 
[...]
> Very likely those dates are valid.  Since you didn't say what timezone
> you are working in I can't look to see what was happening there.
> 

With no further comments to Bob's explanation in 6 years,
I'm closing this bug.

-assaf




bug closed, send any further explanations to 12650 <at> debbugs.gnu.org and Thiago Picharski <thiagopicharski <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 23 Oct 2018 22:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Nov 2018 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.