Simple java date calculation

I want to do simple date calculation in Java For example, calculate the difference in days between dates (with a 0 time component) Of course, you can do a simple millisecond subtraction, divided by the number of milliseconds per day, which works normally - until daylight saving time enters the scene

This kind of calculation seems to be a very common requirement, and I think it is good to discuss this problem in different ways

Solution

I'll look at the joda date / time library, especially the readableinterval class

Joda makes life easier when manipulating date / time in Java. I believe it is the foundation of the new Java JSR 310 wrt Date / time That is, it (or something similar) will appear in future Java versions

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>