LocalTime plus(long amountToAdd, TemporalUnit unit) example
Description
LocalTime plus(long amountToAdd, TemporalUnit unit)
returns a copy of this time with the specified amount added.
Syntax
plus
has the following syntax.
public LocalTime plus(long amountToAdd, TemporalUnit unit)
Example
The following example shows how to use plus
.
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
/* w w w. j ava 2s .com*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.plus(14,ChronoUnit.MINUTES);
System.out.println(s);
}
}
The code above generates the following result.