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

Asked by Mike Bianchi

  cat i

/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

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

Looks like a bug to me ;)

Mike Bianchi

Question information

English Edit question
Ubuntu coreutils Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mike Bianchi (mbianchi-foveal) said :

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.

Revision history for this message
C de-Avillez (hggdh2) said :

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.