/bin/date --date='next month' is wrong

Asked by Mike Bianchi on 2011-01-30

  cat i
/bin/date

/bin/date +'%B'
/bin/date --date='last month' +'%B'
/bin/date --date='this month' +'%B'
/bin/date --date='next month' +'%B'

  sh iSun Jan 30 16:59:31 EST 2011
January
December
January
March

Note that 'this month' == January and 'next month' == March

Looks like a bug to me ;)

Mike Bianchi

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu coreutils Edit question
Assignee:
No assignee Edit question
Last query:
2011-01-30
Last reply:
2011-01-31
Mike Bianchi (mbianchi-foveal) said : #1

More info ...

  uname -a
Linux foveal4 2.6.24-28-generic #1 SMP Wed Nov 24 09:30:14 UTC 2010 i686 GNU/Linux

  date --version
date (GNU coreutils) 6.10
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

C de-Avillez (hggdh2) said : #2

Thank you for this question; as I noted in the linked bug, this is not an issue with coreutils. For more details on why this happen, please see http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e.

Can you help with this problem?

Provide an answer of your own, or ask Mike Bianchi for more information if necessary.

To post a message you must log in.