emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#25560: closed (Alphabetic Character Following date


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#25560: closed (Alphabetic Character Following date -d)
Date: Sat, 28 Jan 2017 10:37:02 +0000

Your message dated Sat, 28 Jan 2017 02:35:59 -0800
with message-id <address@hidden>
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
address@hidden)


-- 
25560: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25560
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Alphabetic Character Following date -d Date: Sat, 28 Jan 2017 06:15:58 +0000 (UTC)
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?



--- End Message ---
--- Begin Message --- Subject: Re: bug#25560: Alphabetic Character Following date -d Date: Sat, 28 Jan 2017 02:35:59 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
Owen Leibman wrote:
Is the date command behaving as it should for all these examples?

Those letters are military time zone abbreviations, so yes.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]