GNU bug report logs - #38003
date --date=-1month gives same month today

Previous Next

Package: coreutils;

Reported by: Ilja Honkonen <ilja.honkonen <at> fmi.fi>

Date: Thu, 31 Oct 2019 14:35:03 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 38003 <at> debbugs.gnu.org (full text, mbox):

From: Ilja Honkonen <ilja.honkonen <at> fmi.fi>
To: Assaf Gordon <assafgordon <at> gmail.com>, 38003 <at> debbugs.gnu.org
Subject: Re: bug#38003: date --date=-1month gives same month today
Date: Wed, 6 Nov 2019 16:05:17 +0200
> Subtracting 1 month from October 31st results in September 31st.
> Since the date doesn't exist, it is normalized:
> September 31st is "one day after September 30th", which
> results in October 1st.

Thanks for explanation. To me it makes more sense that going one month 
back from 31 oct, or last day of oct, would give last day of sep instead 
of first day of oct. But now that I'm aware of this feature I can work 
around it if needed.
Ilja




This bug report was last modified 5 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.