Check a given date is first day of month using joda api

In this post, I will show you how to check whether a given date is first day of the month using joda date time API.

Prerequisites

The following configurations are required in order to run the application

Eclipse
JDK 1.8
Have maven installed and configured
Joda date API dependency in pom.xml

Now we will see the below steps how to create a maven based Java project in Eclipse

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.

maven-arctype-quickstart

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

Group Id : com.roytuts
Artifact Id : java

Step 2. Modify the pom.xml file as shown below.

Step 4. Create a utility class to create utility method

Step 5. Create Junit test case to test the method

Step 6. Run the above Junit, you will get the below output

Thanks for reading.

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.