Archives: Joda Time

Java – Calculate Difference Between Two Dates Using Joda Time

Take a look @ Joda-Time FAQ

You can use a PeriodFormatter to get the format of your choice.

Try the following sample code.

Java – Convert java.util.Date to JodaTime

Make sure date isn’t null, though, otherwise it acts like new new DateTime()