Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 39333 invoked from network); 6 Oct 2006 23:27:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Oct 2006 23:27:39 -0000 Received: (qmail 46397 invoked by uid 500); 6 Oct 2006 23:27:37 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 46332 invoked by uid 500); 6 Oct 2006 23:27:37 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 46319 invoked by uid 99); 6 Oct 2006 23:27:37 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Oct 2006 16:27:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:43547] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 73/6E-24193-766E6254 for ; Fri, 06 Oct 2006 16:27:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 93F857141F5 for ; Fri, 6 Oct 2006 16:27:20 -0700 (PDT) Message-ID: <8463914.1160177240602.JavaMail.root@brutus> Date: Fri, 6 Oct 2006 16:27:20 -0700 (PDT) From: "Henri Yandell (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (LANG-281) DurationFormatUtils returns wrong result In-Reply-To: <1776505.1160067142390.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ 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: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org