Below goes a much simpler test case. Its output says it all.
d0 =2007-02-05 , d1 =2007-02-06 daysBetween=1
d0x=2007-02-05 , d1x=2007-02-06 daysBetween=0
d0.equals(d0x):true ; d1.equals(d1x):true
Isn't this output an unexpected (and inconsistent) behaviour ?
public static void main(String[] args) throws Exception {
DateTimeZone tz = DateTimeZone.UTC;
LocalDate d1 = new LocalDate(2007,2,6);
LocalDate d0 = new LocalDate(2007,2,5);
System.out.print("d0 =" + d0 + " , d1 =" + d1 );
System.out.println(" daysBetween="+ Days.daysBetween(d0, d1).getDays());
long i1x = d1.toDateMidnight(tz).getMillis() ;
LocalDate d1x = new LocalDate(i1x,tz);
LocalDate d0x = new LocalDate(i1x-1,tz);
System.out.print("d0x=" + d0x + " , d1x=" + d1x);
System.out.println(" daysBetween="+ Days.daysBetween(d0x, d1x).getDays());
System.out.print(" d0.equals(d0x):" + d0.equals(d0x));
System.out.println(" ; d1.equals(d1x):" + d1.equals(d1x));
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest