bug-coreutils
[Top][All Lists]
Advanced

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

bug#17374: issue with '/bin/date' resolving months via '-d DATESTR'


From: Benjamin Richardson
Subject: bug#17374: issue with '/bin/date' resolving months via '-d DATESTR'
Date: Tue, 29 Apr 2014 16:17:48 -0400

Hello,

I think my issue can best be described by demonstration. Here goes:

address@hidden /bin/date
Tue Apr 29 15:51:11 EDT 2014
address@hidden /bin/date -d 'last month' +%B
March
address@hidden /bin/date -d '*2 months ago*' +%B
*March*
address@hidden /bin/date -d '3 months ago' +%B
January

I expected 2 months ago to be February, not March. I get that Feb 29
doesn't exist, so returning a date that never happened might not make
sense. But in simply asking for the month, not the full date of 2 months
ago, could %B be calculated first, before rolling over to March 1st?

Here is some other potentially helpful info:

address@hidden rpm -qf /bin/date
coreutils-5.97-34.el5_8.1
address@hidden date -d '1 month ago'
Sat Mar 29 15:57:36 EDT 2014
address@hidden date -d '2 months ago'
Sat Mar  1 14:57:45 EST 2014
address@hidden date -d '3 months ago'
Wed Jan 29 14:58:41 EST 2014

Thanks!
Ben


reply via email to

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