import hirondelle.date4j.DateTime;
public class Date4jExample {
public static void main(String[] args) {
DateTime now = DateTime.now();
DateTime future = now.plusDays(4);
if (future.gt(now)) {
} else {
}
String formattedDate = now.format("YYYY-MM-DD");
}
}
<dependency>
<groupId>com.date4j</groupId>
<artifactId>date4j</artifactId>
<version>1.0.0</version>
</dependency>