DateTime now = new DateTime(); // current date and time DateTime future = now.plusDays(5); // adds 5 days to current date and time System.out.println(future);
2021-10-05T11:25:30.417+05:30
DateTime dateTime = new DateTime(2021, 10, 1, 14, 30); // specific date and time DateTime future = dateTime.plusDays(2); // adds 2 days to specific date and time System.out.println(future);
2021-10-03T14:30:00.000+05:30These examples use the org.joda.time.DateTime class from the joda-time-2.10.11.jar package library.