Subject: Re: bug#26101: Counterproductive calculation order in date

From: Ulf Zibis <[email-masked]>
Date: Thu, 16 Mar 2017 00:27:50 +0100

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