[ 
https://issues.apache.org/jira/browse/LANG-677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henri Yandell updated LANG-677:
-------------------------------

    Fix Version/s:     (was: 2.x)
                   2.7

> 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.7
>
>
> 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 was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to