Bug 220934 - Date calculation error for date command
Date calculation error for date command
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils (Show other bugs)
4.3
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
: 220935 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-28 20:28 EST by kennychw
Modified: 2007-11-16 20:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-29 08:17:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description kennychw 2006-12-28 20:28:58 EST
Description of problem:
When I run the following date command on 29 December 2006 to obtain the month 
number for 10 month ago, the command return march instead of February

Version-Release number of selected component (if applicable):
coreutils-5.2.1-31.2

How reproducible:
$ date
Fri Dec 29 09:15:42 SGT 2006
$ date -d '10 months ago' +%m
03

Steps to Reproduce:
1.
2.
3.
  
Actual results:
03

Expected results:
02

Additional info:
Comment 1 Tim Waugh 2006-12-29 08:03:56 EST
*** Bug 220935 has been marked as a duplicate of this bug. ***
Comment 2 Tim Waugh 2006-12-29 08:17:09 EST
Since 2006 is not a leap year, this is expected behaviour.  Adjusting only the
month field leaves us with February 29th, which did not exist this year.  Feb 29
is canonicalised to Feb 28th + 1 day, so March is the expected result.

Note You need to log in before you can comment on or make changes to this bug.