Web lists-archives.com

Re: policy around 'wontfix' bug tag






Em 06-02-2018 10:38, Vincent Lefevre escreveu:
On 2018-02-06 13:48:19 +0100, Vincent Lefevre wrote:
This is completely crazy:

zira% date +%Y-%m-%d -d '2003-09-01 1 day ago + 1 month'
2003-09-30
zira% date +%Y-%m-%d -d '2003-09-01 1 day ago'
2003-08-31
zira% date +%Y-%m-%d -d '2003-08-31 + 1 month'
2003-10-01

So, while '2003-09-01 1 day ago' gives 2003-08-31, the following
are not equivalent:
   * '2003-09-01 1 day ago + 1 month'
   * '2003-08-31 + 1 month'

Where is the logic behind that?
Other ones:

zira% date +%Y-%m-%d -d '2003-02-01 - 1 month'
2003-01-01
zira% date +%Y-%m-%d -d '2003-02-01 - 31 days'
2003-01-01
zira% date +%Y-%m-%d -d '2003-02-01 - 31 days + 1 month'
2003-01-29
I guess first step done is the sum and then, subtract 31 days.
So, as the fev is a month just with 28 days, end up at 2003-01-29.
zira% date +%Y-%m-%d -d '2003-02-01 - 1 month + 1 month'
2003-02-01

--
Lucas Castro