JVM Languages

Tools

How do I create DateTime object in Joda-Time?

The following example show you a various way to create an instance of Joda-Time’s DateTime class. By using the default constructor we will create an object with the current system date time. We can also create the object by passing the information like year, month, day, hour, minutes and second.

Joda can also use an instance from JDK’s java.util.Date and java.util.Calendar to create the DateTime. This means that the date object of JDK and Joda can be used to work together in our application.