From issues-return-17412-apmail-commons-issues-archive=commons.apache.org@commons.apache.org Thu Mar 03 04:35:58 2011 Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 84638 invoked from network); 3 Mar 2011 04:35:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Mar 2011 04:35:58 -0000 Received: (qmail 41744 invoked by uid 500); 3 Mar 2011 04:35:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 41686 invoked by uid 500); 3 Mar 2011 04:35:55 -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 41676 invoked by uid 99); 3 Mar 2011 04:35:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 04:35:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 04:35:56 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DD9754DF9B for ; Thu, 3 Mar 2011 04:35:36 +0000 (UTC) Date: Thu, 3 Mar 2011 04:35:36 +0000 (UTC) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Message-ID: <1535809356.10157.1299126936904.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1005026546.5209.1296659428966.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Closed: (LANG-677) DateUtils.isSameLocalTime does not work correct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell closed LANG-677. ------------------------------ Resolution: Fixed Fix Version/s: (was: 3.1) 3.0 > DateUtils.isSameLocalTime does not work correct > ----------------------------------------------- > > Key: LANG-677 > URL: https://issues.apache.org/jira/browse/LANG-677 > Project: Commons Lang > Issue Type: Bug > Components: lang.time.* > Environment: linux 2.6.32-28, java version "1.6.0_22" > Reporter: Christian > Fix For: 3.0, 2.x > > > Hi, I think I found a bug in the DateUtils class in the method isSameLocalTime. > Example: > Calendar a = Calendar.getInstance(); > a.setTimeInMillis(1297364400000L); > Calendar b = Calendar.getInstance(); > b.setTimeInMillis(1297321200000L); > Assert.assertFalse(DateUtils.isSameLocalTime(a, b)); > This is because the method compares > cal1.get(Calendar.HOUR) == cal2.get(Calendar.HOUR) > but I think it has to be > cal1.get(Calendar.HOUR_OF_DAY) == cal2.get(Calendar.HOUR_OF_DAY) > -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira