GNU bug report logs - #11667
problem with command date

Previous Next

Package: coreutils;

Reported by: amanda sabatini <amanda.dufek <at> gmail.com>

Date: Sun, 10 Jun 2012 17:57:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.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 11667 in the body.
You can then email your comments to 11667 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#11667; Package coreutils. (Sun, 10 Jun 2012 17:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to amanda sabatini <amanda.dufek <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 10 Jun 2012 17:57:02 GMT) Full text and rfc822 format available.

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

From: amanda sabatini <amanda.dufek <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: problem with command date
Date: Sun, 10 Jun 2012 12:54:09 -0300
[Message part 1 (text/plain, inline)]
Hi,

The follow command does not work with the specifics date: 1986-10-25;
1987-10-25; 1989-10-15; 1992-10-25; 1991-10-20; 1995-10-15; 2006-11-05.

date +%d --date="1986-10-25"

Sincerely,
Amanda Sabatini Dufek
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#11667; Package coreutils. (Mon, 11 Jun 2012 00:01:02 GMT) Full text and rfc822 format available.

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

From: "Alan Curry" <pacman-cu <at> kosh.dhis.org>
To: amanda.dufek <at> gmail.com (amanda sabatini)
Cc: 11667 <at> debbugs.gnu.org
Subject: Re: bug#11667: problem with command date
Date: Sun, 10 Jun 2012 18:58:03 -0500 (GMT+5)
amanda sabatini writes:
> 
> Hi,
> 
> The follow command does not work with the specifics date: 1986-10-25;
> 1987-10-25; 1989-10-15; 1992-10-25; 1991-10-20; 1995-10-15; 2006-11-05.
> 
> date +%d --date="1986-10-25"

The date command never actually works on dates alone. There is always a time
attached to its calculations, even when it's not necessary for the output
format you requested.

When you don't specify a time with the --date option, the command guesses
that you meant 00:00:00. That turns out to be a bad guess in this case, since
00:00:00 didn't exist on those days.

All of those are dates on which the Brazil/East time zone shifted into
daylight savings time, jumping from 23:59:59 the previous day to 01:00:00 on
the day you mentioned.

You can avoid this problem by adding 12:00:00 to the requested date.

$ TZ=Brazil/East date +%d --date="1986-10-25"
date: invalid date `1986-10-25'
$ TZ=Brazil/East date +%d --date="1986-10-25 12:00:00"
25

-- 
Alan Curry




bug closed, send any further explanations to 11667 <at> debbugs.gnu.org and amanda sabatini <amanda.dufek <at> gmail.com> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 11 Jun 2012 00:08:02 GMT) Full text and rfc822 format available.

Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 11 Jun 2012 00:08: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. (Mon, 09 Jul 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 41 days ago.

Previous Next


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