bug-coreutils
[Top][All Lists]
Advanced

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

bug#26101: Counterproductive calculation order in date


From: Ulf Zibis
Subject: bug#26101: Counterproductive calculation order in date
Date: Thu, 16 Mar 2017 00:27:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


Am 15.03.2017 um 16:53 schrieb Pádraig Brady:
 "coreutils FAQ"

By the way, I think there is a typo:

$ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B.'
Last month was June.

$ date --date="$(date +%Y-%m-15) +1 month" +'Next month will be %B.'
Next month will be May.

Compared with:

$ thismonth=$(date --date="@$now" "+%Y-%m-15 12:00")
$ echo "LastMonth=$(date -d "$thismonth 1 month ago" +%B), NextMonth=$(date -d 
"$thismonth 1 month" +%B)."
LastMonth=March, NextMonth=May.

I assume, in the first example, it should be:

Last month was *March*.


-Ulf

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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