【发布时间】:2013-06-18 15:23:43
【问题描述】:
我正在处理的事情与这里所问的非常相似 - compare Joda-Time time zones 但它似乎对我不起作用。
这是我正在测试Joda-Time DateTime 的一段代码 -
DateTime estDT = new DateTime(DateTimeZone.forID("America/Puerto_Rico")).withMillisOfSecond(0);
DateTime londonDT = new DateTime(DateTimeZone.forID("Europe/London")).withMillisOfSecond(0);
System.out.println("Comparison " + londonDT.isBefore(estDT));
System.out.println("Comparison " + londonDT.isAfter(estDT));
有趣的是,我从上面的两个 sysout 语句中都得到了“错误”。谁能解释一下进行这种比较的正确方法是什么?
【问题讨论】: