GNU bug report logs - #17451
date command: Bug?

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Fri, 9 May 2014 18:18:02 UTC

Severity: wishlist

Tags: notabug, patch

To reply to this bug, email your comments to 17451 AT debbugs.gnu.org.

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#17451; Package coreutils. (Fri, 09 May 2014 18:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 09 May 2014 18:18:02 GMT) Full text and rfc822 format available.

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

From: "Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: date command: Bug?
Date: Fri, 9 May 2014 18:07:06 +0000
[Message part 1 (text/plain, inline)]
When querying the time zone, the date command cannot deal with the hour when time changes from standard time to daylight saving time.  Below examples show the tests done in the Pacific time zone.

-----------------------------------------------------------------------------------------------------------------------------------------------

date -d "20120311 01" +%:::z
-08

date -d "20120311 02" +%:::z
date: invalid date `20120311 02'

date -d "20120311 03" +%:::z
-07

date -d "20140309 01" +%:::z
-08

date -d "20140309 02" +%:::z
date: invalid date `20140309 02'

date -d "20140309 03" +%:::z
-07
[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Sat, 10 May 2014 19:20:02 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Sat, 10 May 2014 19:20:03 GMT) Full text and rfc822 format available.

Notification sent to "Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>:
bug acknowledged by developer. (Sat, 10 May 2014 19:20:04 GMT) Full text and rfc822 format available.

Message #12 received at 17451-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: "Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>, 17451-done <at> debbugs.gnu.org
Subject: Re: bug#17451: date command: Bug?
Date: Sat, 10 May 2014 13:19:03 -0600
[Message part 1 (text/plain, inline)]
tag 17451 notabug
thanks

On 05/09/2014 12:07 PM, Yin, Dazhong <at> ARB wrote:
> When querying the time zone, the date command cannot deal with the hour when time changes from standard time to daylight saving time.

That's because that hour does not exist in your timezone.

All of your examples look like correct behavior to me.  You've asked a FAQ:
https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e

Our advice is to compute dates in UTC, or when sticking to a locale with
daylight savings, then compute dates relative to noon rather than near
the hour that might disappear or be doubled.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#17451; Package coreutils. (Sat, 10 May 2014 19:24:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>, 17451 <at> debbugs.gnu.org
Subject: Let's patch 'date' to suggest the FAQ for invalid date formats
Date: Sat, 10 May 2014 12:23:19 -0700
[Message part 1 (text/plain, inline)]
This topic comes up often enough that I'm inclined to add an FAQ pointer 
into that diagnostic issued by 'date'.  Proposed patch is attached.  I 
suppose we could try for a more-stable URL, but one step at a time.
[0001-date-point-people-at-the-FAQ-for-invalid-date-format.patch (text/plain, attachment)]

Changed bug submitter to 'Paul Eggert <eggert <at> cs.ucla.edu>' from '"Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 10 May 2014 19:26:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 10 May 2014 19:26:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 10 May 2014 19:26:02 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 10 May 2014 19:26:02 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 40 days ago.

Previous Next


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