[ http://issues.apache.org/jira/browse/LANG-281?page=all ]
Henri Yandell updated LANG-281:
-------------------------------
Attachment: LANG-281-test.patch
Unit test attached.
> DurationFormatUtils returns wrong result
> ----------------------------------------
>
> Key: LANG-281
> URL: http://issues.apache.org/jira/browse/LANG-281
> Project: Commons Lang
> Issue Type: Bug
> Affects Versions: 2.1, 2.2
> Environment: Win xp pro
> Reporter: stlum9495
> Fix For: 2.3
>
> Attachments: LANG-281-test.patch
>
>
> DurationFormatUtils returns wrong result. oddly, it is only when Date is set
> to Dec 31, 2005
> The following code will result in a String of -2 which is way off.
> I've tested against 2.1 and 2.2.
> Calendar cal = Calendar.getInstance();
> cal.set(Calendar.MONTH, Calendar.DECEMBER);
> cal.set(Calendar.DAY_OF_MONTH, 31);
> cal.set(Calendar.YEAR, 2005);
> cal.set(Calendar.HOUR_OF_DAY, 0);
> cal.set(Calendar.MINUTE, 0);
> cal.set(Calendar.SECOND, 0);
> cal.set(Calendar.MILLISECOND, 0);
> String result =
> DurationFormatUtils.formatPeriod(cal.getTimeInMillis(),
> System.currentTimeMillis(), "MM");
> System.out.println(result);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]