LocalTime plus(long amountToAdd, TemporalUnit unit)
returns a copy of this time with the specified amount added.
plus
has the following syntax.
public LocalTime plus(long amountToAdd, TemporalUnit unit)
The following example shows how to use plus
.
import java.time.LocalTime; import java.time.temporal.ChronoUnit; //from w w w . j av a 2 s .c om 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.