Usage of Joda Date Time API

This tutorial shows how we can use joda date time API.

Java’s standard date and time classes (mainly java.util.Date and java.util.Calendar) have limited functionality and have a number of design problems. The fact that many of constructors and methods of java.util.Date are deprecated.

Joda Time has a better thought out API than what is available in Java’s date and time standard library. There are classes for timestamps with or without a timezone, classes for holding only a date (year, month, day) or only a time of day, classes for periods, durations and intervals, it supports the ISO 8601 format (which is the standard format in XML documents) and much more.

Now JDK 8 is out and it has a new date and time API which is similar to Joda Time. For more information please read package java.time.

JDK 1.6 or later
Eclipse 3.2 or later
Maven 2 or later
Joda Date Time API

Now we will see how we can make this happen step by step

Step 1. Create a standalone maven project in Eclipse

Go to File -> New -> Other. On popup window under Maven select Maven Project. Then click on Next. Select the workspace location – either default or browse the location. Click on Next. Now in next window select the row as highlighted from the below list of archtypes and click on Next button.


Now enter the required fields (Group Id, Artifact Id) as shown below

Group Id : com.roytuts
Artifact Id : joda-date-time

Step 2. Add joda-time dependency to the pom.xml file.

Step 3. Write a class which will show how to use joda date time

Step 4. Now run the above class and see the output in the console.

That’s all. Thank you for reading.


Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.