2
我寫使用JDK 8類ChronoUnit和ZonedDateTime替代爲ZonedDateTime和ChronoUnit 7
// if no timestamp was present, calculate difference between last and this date
timestamp = pos.getFirstDateStamp().until(datestamp, ChronoUnit.MILLIS)/(double) 1000;
但是這行代碼,分支正在使用JDK 7編譯的,因此我面臨的問題,我想知道這些替代類。
我嘗試過TimeUnit.MILLISECONDS
,但until()
是ZonedDateTime
的一部分,似乎有問題。
Java 7的這些類有一個backport:http://www.threeten.org/threetenbp/ –