Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 11459 invoked from network); 2 Jun 2008 20:50:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jun 2008 20:50:07 -0000 Received: (qmail 25508 invoked by uid 500); 2 Jun 2008 20:50:09 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 25075 invoked by uid 500); 2 Jun 2008 20:50:08 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 25064 invoked by uid 99); 2 Jun 2008 20:50:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 13:50:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 20:49:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0F911234C12C for ; Mon, 2 Jun 2008 13:49:45 -0700 (PDT) Message-ID: <1423364544.1212439785062.JavaMail.jira@brutus> Date: Mon, 2 Jun 2008 13:49:45 -0700 (PDT) From: "Robert Scholte (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (LANG-440) DateUtils.round doesn't work correct for Calendar.AM_PM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org DateUtils.round doesn't work correct for Calendar.AM_PM ------------------------------------------------------- Key: LANG-440 URL: https://issues.apache.org/jira/browse/LANG-440 Project: Commons Lang Issue Type: Bug Affects Versions: 2.4 Reporter: Robert Scholte Fix For: 3.0 The provided JUnit-tests test with wrong expected values {code:title= original DateUtilsTest.java} dateAmPm1 = dateTimeParser.parse("February 3, 2002 01:10:00.000"); dateAmPm2 = dateTimeParser.parse("February 3, 2002 11:10:00.000"); dateAmPm3 = dateTimeParser.parse("February 3, 2002 13:10:00.000"); dateAmPm4 = dateTimeParser.parse("February 3, 2002 19:10:00.000"); assertEquals("truncate ampm-1 failed", dateTimeParser.parse("February 3, 2002 00:00:00.000"), DateUtils.round(dateAmPm1, Calendar.AM_PM)); assertEquals("truncate ampm-2 failed", dateTimeParser.parse("February 4, 2002 00:00:00.000"), DateUtils.round(dateAmPm2, Calendar.AM_PM)); assertEquals("truncate ampm-3 failed", dateTimeParser.parse("February 3, 2002 12:00:00.000"), DateUtils.round(dateAmPm3, Calendar.AM_PM)); assertEquals("truncate ampm-4 failed", dateTimeParser.parse("February 4, 2002 12:00:00.000"), DateUtils.round(dateAmPm4, Calendar.AM_PM)); {code} but expected values must be {code} dateTimeParser.parse("February 3, 2002 00:00:00.000"); dateTimeParser.parse("February 3, 2002 12:00:00.000"); dateTimeParser.parse("February 3, 2002 12:00:00.000"); dateTimeParser.parse("February 4, 2002 00:00:00.000"); {code} Also in the junit-comment the word 'truncate' must be replaced with 'round' -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.