I am currently ditching all usages of java.util Date implementations from my project and want to change everything to Classes from the java.time
package.
Now I found a usage of the roll method of a java.util.Calendar
object and I am wondering how I can change this to something from the java.time package
.
I checked if the date classes of java.time have a roll method, but I could not find any.
ZonedDateTime.now().roll(); // method does not exist
LocalDateTime.now().roll(); // method does not exist
LocalDate.now().roll(); // method does not exist
I'm looking for something from the java.time package that does the same as the roll method from the java.util.Calendar
class.
Somebody already asked a similiar question: What is the equivalent of Calendar.roll in java.time? But I find the accepted answer unsatisfactory. It does not answer whether there is something similar to roll in java.time or not.