GNU bug report logs -
#25560
Alphabetic Character Following date -d
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 28 Jan 2017 02:35:59 -0800
with message-id <4712b2cb-309c-bb0b-2d69-d73c758a2f0a <at> cs.ucla.edu>
and subject line Re: bug#25560: Alphabetic Character Following date -d
has caused the debbugs.gnu.org bug report #25560,
regarding Alphabetic Character Following date -d
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
25560: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25560
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Testing a script to see how it handled invalid data, I had it execute the command:
date -d "x023-04-05 01:00"
Somewhat surprisingly, this was not treated as an error. The response was:
Tue Apr 4 06:07:02 LMT 0023
This happened on a Ubuntu system using coreutils-8.25.
However, I was not able to duplicate it on a Cygwin system using coreutils 8.26,
Where the date was flagged as invalid.
So, at a guess, this was a bug that was fixed in 8.26.
But, not so fast - the following commands give identical surprising results with both versions
(for convenience, I set my time zone to UTC before issuing these commands):
date -d a
Sat, Jan 28, 2017 1:00:00 AM
I searched the man and info pages in vain for how the command might be interpreting "a" here.
If there is some place where this is documented and I just missed it, please let me know.
In the meantime, I'll continue.
I tried other letters - "b" through "i" each advanced the displayed time by 1 hour (so "i" was 9:00).
Upper- and lower-case were treated the same.
At "j", I had a surprise:
date -d j
date: invalid date ājā
But then I was equally surprised by "k":
date -d k
Sat, Jan 28, 2017 10:00:00 AM
It seems to have picked up where the sequence was broken.
Continuing, "l" advanced to 11:00, and "m" to 12:00 (PM - presumably noon).
Another surprise came with "n":
date -d n
Fri, Jan 27, 2017 11:00:00 PM
From that point, the result marches backwards by an hour each time until "x" reaches 1:00 p.m.
Then "y" matches the output for "m". And "z":
date -d z
Sat, Jan 28, 2017 12:00:00 AM
And, having run out of letters, my test was complete.
Is the date command behaving as it should for all these examples?
[Message part 3 (message/rfc822, inline)]
Owen Leibman wrote:
> Is the date command behaving as it should for all these examples?
Those letters are military time zone abbreviations, so yes.
This bug report was last modified 8 years and 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.