GNU bug report logs -
#17451
date command: Bug?
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 10 May 2014 13:19:03 -0600
with message-id <536E7BA7.2050607 <at> redhat.com>
and subject line Re: bug#17451: date command: Bug?
has caused the debbugs.gnu.org bug report #17451,
regarding date command: Bug?
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> 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)]
[Message part 3 (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 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (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)]
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.