GNU bug report logs -
#38003
date --date=-1month gives same month today
Previous Next
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 #8 received at 38003 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
There will be a discontinuity as long as the months are different lengths.
In the current implementation there will be only one discontinuity per
month; the 1st of the month always goes back to the 1st of the preceding
month. The overlap into the next month continues linearly until "now" is
the 1st of the month.
If I understand correctly, you would prefer that on March 29th, 30th, and
31st, this command would return the same date (except on leap years)?
$ date --date=-1month +"%m-%d"
02-28
This would introduce one to three discontinuities per month, but the
calculated month difference always the preceding month.
On Thu, Oct 31, 2019 at 3:46 PM Ilja Honkonen <ilja.honkonen <at> fmi.fi> wrote:
> Hello
> Please CC me as I'm not on this list. Running date (GNU coreutils) 8.26
> on fedora 30 today (date --utc -I: 2019-10-31) with --date=-1month gives
> the same month which doesn't make sense:
> $ date --utc -I --date=-1month
> 2019-10-01
> I assume using --date=-31day also wouldn't work if run e.g. in beginning
> of march so this looks like a bug. Same happens also without --utc and
> -I. Thanks
> Ilja
>
>
>
>
[Message part 2 (text/html, inline)]
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.