Today I tried to calculate some interest rates for one of my customers. In Germany we have several different and complicated calculation rules…

To solve this problem I used the Joda Time framework. This is a complete replacement for java.util.Calendar. When you ever tried to do any calculations related to dates, you know that *every* framework is better than java.util.Calendar….

And Joda Time is really great. You need some minutes to understand which interfaces to use (ReadableDateTime is a default replacement for java.util.Calendar). But especially the possibility to get many informations about a period between to dates is great. Joda Time fully supports several types of describing those periods. A period may be half a year, 6 months, 26 weeks, 182 days or a composition of them (1 year, 2 months and 15 days).
All you need is just a specific org.joda.time.PeriodType.