Add one day into Joda-Time DateTime
Solution 1:
The plusDays
method is not a mutator. It returns a copy of the given DateTime
object with the change made rather than changing the given object.
If you want to actually change the variable dateTime
value, you'll need:
DateTime dateTime = new DateTime(date);
dateTime = dateTime.plusDays(1);
Solution 2:
If you want add days to current date time instance, use MutableDateTime
MutableDateTime dateTime = new MutableDateTime(date);
dateTime.addDays(1);