我尝试将某个日期与 jodaTime 进行比较,我使用周和年来比较日期
DateMidnight endDate01 = new DateMidnight().withYear(2012).withWeekyear(37);
DateMidnight endDate02 = new DateMidnight().withYear(2012).withWeekyear(38);
endDate01.isBefore(endDate02); //return false
我不明白为什么 endDate01 看起来比 endDate02 更大。
也许是一个错误?
DateMidnight endDate01 = new DateMidnight();
endDate01.withYearOfEra(o1.getEndYearPeriod());
endDate01.withWeekOfWeekyear(o1.getEndWeekPeriod());
System.out.println(o1.getEndWeekPeriod() + " " + o1.getEndYearPeriod());
System.out.println(endDate01.getWeekOfWeekyear() + " " + endDate01.getYearOfEra());
我明白了
37 2012
16 2012
应该得到相同的结果,不是吗?