Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 c++ 的 jave 新手。我想知道如何使用 http://xmlbeans.apache.org/docs/2.0.0/reference/org/apache/xmlbeans/GDate.html 中指定的Gdate
谁能举一个简单的例子,如何使用 Gdate 计算两个日期之间的时间段?或者也许只是当前日期......
谢谢
仅查看 API 规范,以下代码似乎应该为您提供以毫秒为单位的时间段
public long dateDiffInMillis (final GDate date1, final GDate date2) { return date1.getCalendar ().getTimeInMillis () - date2.getCalendar ().getTimeInMillis (); }