LocalTime plus(TemporalAmount amountToAdd)
returns a
copy of this time with the specified amount added.
plus
has the following syntax.
public LocalTime plus(TemporalAmount amountToAdd)
The following example shows how to use plus
.
import java.time.Duration; import java.time.LocalTime; // ww w . j a va 2s. c o m public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.plus(Duration.ofHours(1)); System.out.println(s); } }
The code above generates the following result.