问题
The Java 8 way of dealing with time seems to have improved so much that I start to think about replacing jodatime in some cases. But what I am missing is an equivalent to the Interval class.
I haven't dug too deep into Java 8 yet, so I might have missed something there. Does anyone have ideas on how intervals could be best dealt with?
回答1:
No way, the Joda class Interval
does not exist in JSR-310. The concepts of Duration
, Period
etc. denotes temporal amounts without being bound to fixed points in time while an interval has a fixed start and fixed end on the timeline.
By the way, this question is not new and a duplicate. On the other SO-link you can also find a similar answer direct from JodaTime-project-leader.
来源:https://stackoverflow.com/questions/22886030/equivalent-to-jodatime-interval-in-java-8-date-and-time-api