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

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Yin, Dazhong <at> ARB" <dyin <at> arb.ca.gov>
Subject: bug#17451: closed (Re: bug#17451: date command: Bug?)
Date: Sat, 10 May 2014 19:20:04 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#17451: date command: Bug?

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 17451 <at> debbugs.gnu.org.

-- 
17451: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17451
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
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 6 (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 7 (text/html, inline)]

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.